Skip to content

Commit

Permalink
hack at build not buildx
Browse files Browse the repository at this point in the history
  • Loading branch information
binhex committed Feb 22, 2021
1 parent cd9197d commit 32938aa
Showing 1 changed file with 10 additions and 31 deletions.
41 changes: 10 additions & 31 deletions .github/workflows/docker-tag-triggered-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,60 +9,39 @@ jobs:
gcr-dockerhub-build-publish:
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v2
-
name: Set up QEMU
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
# TODO(#122): Remove step when https://github.com/actions/virtual-environments/issues/2658 fixed
- # TODO(#122): Remove step when https://github.com/actions/virtual-environments/issues/2658 fixed
name: Update runc # https://github.com/actions/virtual-environments/issues/2698#issuecomment-779262068
run: |
sudo apt-get install libseccomp-dev
git clone https://github.com/opencontainers/runc
cd runc
make
sudo make install
-
name: Login to DockerHub
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GitHub Container Registry
- 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)
- name: Show Runners environment (debug)
shell: bash
run: export
-
name: Identify GitHub tag name
- name: Build image
run: docker build .
- name: Identify GitHub tag name
shell: bash
# 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
# name (docker hub does support it).
# 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//+/-}")"
id: identify_tag
-
name: Build and Push to GCR and Docker Hub
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:latest
${{ github.repository }}:${{ steps.identify_tag.outputs.tag }}
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ steps.identify_tag.outputs.tag }}
id: identify_tag

0 comments on commit 32938aa

Please sign in to comment.