switch from buildx to manual build steps

pull/94/head
binhex 3 years ago
parent 0a67817bc3
commit 3d1529c169

@ -11,40 +11,41 @@ jobs:
gcr-dockerhub-build-publish: gcr-dockerhub-build-publish:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- - name: Checkout
name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- - name: Update runc (temporary fix) # TODO: Remove step when https://github.com/actions/virtual-environments/issues/2658 fixed
name: Set up QEMU run: |
uses: docker/setup-qemu-action@v1 sudo apt-get install libseccomp-dev
- git clone https://github.com/opencontainers/runc
name: Set up Docker Buildx cd runc
uses: docker/setup-buildx-action@v1 make
- sudo make install
name: Login to DockerHub - name: Login to Docker Hub
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- - name: Login to GitHub Container Registry
name: Login to GitHub Container Registry
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.repository_owner }} username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }} password: ${{ secrets.CR_PAT }}
- - name: Show Runners environment (debug)
name: Show Runners environment (debug)
shell: bash shell: bash
run: export run: export
- - name: Build Docker image and tag
name: Build and Push to GCR and Docker Hub run: |
uses: docker/build-push-action@v2 docker build \
with: --tag ${{ github.repository }}:latest \
context: . --tag ${{ github.repository }}:${{ steps.identify_tag.outputs.tag }} \
file: ./Dockerfile --tag ghcr.io/${{ github.repository }}:latest \
platforms: linux/amd64 --tag ghcr.io/${{ github.repository }}:${{ steps.identify_tag.outputs.tag }} \
push: true .
tags: | - name: Push Docker image to Docker Hub
${{ github.repository }}:${{ github.event.inputs.tags }} run: |
ghcr.io/${{ github.repository }}:${{ github.event.inputs.tags }} docker push ${{ github.repository }}:${{ github.event.inputs.tags }}
- name: Push Docker image to GitHub Container Registry (GHCR)
run: |
docker push ghcr.io/${{ github.repository }}:${{ github.event.inputs.tags }}
docker push ghcr.io/${{ github.repository }}:${{ github.event.inputs.tags }}

@ -9,34 +9,30 @@ jobs:
gcr-dockerhub-build-publish: gcr-dockerhub-build-publish:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- - name: Checkout
name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- - name: Update runc (temporary fix) # TODO: Remove step when https://github.com/actions/virtual-environments/issues/2658 fixed
name: Set up QEMU run: |
uses: docker/setup-qemu-action@v1 sudo apt-get install libseccomp-dev
- git clone https://github.com/opencontainers/runc
name: Set up Docker Buildx cd runc
uses: docker/setup-buildx-action@v1 make
- sudo make install
name: Login to DockerHub - name: Login to Docker Hub
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- - name: Login to GitHub Container Registry (GHCR)
name: Login to GitHub Container Registry
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.repository_owner }} username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }} password: ${{ secrets.CR_PAT }}
- - name: Show Runners environment (debug)
name: Show Runners environment (debug)
shell: bash shell: bash
run: export run: export
- - name: Identify GitHub tag name
name: Identify GitHub tag name
shell: bash shell: bash
# get tag name from runners environment 'GITHUB_REF' and then use bash substring # get tag name from runners environment 'GITHUB_REF' and then use bash substring
# to strip out '+' symbol - required due to gcr not supporting this as a tag # to strip out '+' symbol - required due to gcr not supporting this as a tag
@ -44,16 +40,19 @@ jobs:
# note if push is NOT triggered by tag then 'GITHUB_REF' will be the branch name. # note if push is NOT triggered by tag then 'GITHUB_REF' will be the branch name.
run: echo "##[set-output name=tag;]$(tag_name=${GITHUB_REF#refs/tags/} && echo "${tag_name//+/-}")" run: echo "##[set-output name=tag;]$(tag_name=${GITHUB_REF#refs/tags/} && echo "${tag_name//+/-}")"
id: identify_tag id: identify_tag
- - name: Build Docker image and tag
name: Build and Push to GCR and Docker Hub run: |
uses: docker/build-push-action@v2 docker build \
with: --tag ${{ github.repository }}:latest \
context: . --tag ${{ github.repository }}:${{ steps.identify_tag.outputs.tag }} \
file: ./Dockerfile --tag ghcr.io/${{ github.repository }}:latest \
platforms: linux/amd64 --tag ghcr.io/${{ github.repository }}:${{ steps.identify_tag.outputs.tag }} \
push: true .
tags: | - name: Push Docker image to Docker Hub
${{ github.repository }}:latest run: |
${{ github.repository }}:${{ steps.identify_tag.outputs.tag }} docker push ${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:latest docker push ${{ github.repository }}:${{ steps.identify_tag.outputs.tag }}
ghcr.io/${{ github.repository }}:${{ steps.identify_tag.outputs.tag }} - name: Push Docker image to GitHub Container Registry (GHCR)
run: |
docker push ghcr.io/${{ github.repository }}:latest
docker push ghcr.io/${{ github.repository }}:${{ steps.identify_tag.outputs.tag }}
Loading…
Cancel
Save