|
|
|
name: docker-manual-triggered-test
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
tags:
|
|
|
|
description: 'Enter tag name for test/dev image'
|
|
|
|
default: 'test'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
gcr-dockerhub-build-publish:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Update runc (temporary fix) # TODO: Remove step when https://github.com/actions/virtual-environments/issues/2658 fixed
|
|
|
|
uses: nick-invision/retry@v2.4.0
|
|
|
|
with:
|
|
|
|
timeout_minutes: 5
|
|
|
|
max_attempts: 3
|
|
|
|
retry_wait_seconds: 120
|
|
|
|
retry_on: error
|
|
|
|
command: |
|
|
|
|
sudo apt-get install libseccomp-dev
|
|
|
|
git clone https://github.com/opencontainers/runc
|
|
|
|
cd runc
|
|
|
|
make
|
|
|
|
sudo make install
|
|
|
|
- name: Login to Docker Hub
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Login to GitHub Container Registry
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.repository_owner }}
|
|
|
|
password: ${{ secrets.CR_PAT }}
|
|
|
|
- name: Show Runners environment (debug)
|
|
|
|
uses: nick-invision/retry@v2.4.0
|
|
|
|
with:
|
|
|
|
timeout_minutes: 5
|
|
|
|
max_attempts: 3
|
|
|
|
retry_wait_seconds: 120
|
|
|
|
retry_on: error
|
|
|
|
command: |
|
|
|
|
export
|
|
|
|
- name: Build Docker image and tag
|
|
|
|
uses: nick-invision/retry@v2.4.0
|
|
|
|
with:
|
|
|
|
timeout_minutes: 60
|
|
|
|
max_attempts: 3
|
|
|
|
retry_wait_seconds: 120
|
|
|
|
retry_on: error
|
|
|
|
command: |
|
|
|
|
docker build \
|
|
|
|
--tag ${{ github.repository }}:${{ github.event.inputs.tags }} \
|
|
|
|
--tag ghcr.io/${{ github.repository }}:${{ github.event.inputs.tags }} \
|
|
|
|
.
|
|
|
|
- name: Push Docker image to Docker Hub
|
|
|
|
uses: nick-invision/retry@v2.4.0
|
|
|
|
with:
|
|
|
|
timeout_minutes: 30
|
|
|
|
max_attempts: 3
|
|
|
|
retry_wait_seconds: 120
|
|
|
|
retry_on: error
|
|
|
|
command: |
|
|
|
|
docker push ${{ github.repository }}:${{ github.event.inputs.tags }}
|
|
|
|
- name: Push Docker image to GitHub Container Registry (GHCR)
|
|
|
|
uses: nick-invision/retry@v2.4.0
|
|
|
|
with:
|
|
|
|
timeout_minutes: 30
|
|
|
|
max_attempts: 3
|
|
|
|
retry_wait_seconds: 120
|
|
|
|
retry_on: error
|
|
|
|
command: |
|
|
|
|
docker push ghcr.io/${{ github.repository }}:${{ github.event.inputs.tags }}
|