2021-01-06 01:53:58 +03:00
|
|
|
name: buildx
|
|
|
|
|
|
|
|
on:
|
2021-10-12 05:11:31 +03:00
|
|
|
workflow_run:
|
|
|
|
workflows: ["tests"]
|
|
|
|
branches: [main]
|
|
|
|
types:
|
|
|
|
- completed
|
2021-01-06 01:53:58 +03:00
|
|
|
|
|
|
|
jobs:
|
2021-10-12 05:11:31 +03:00
|
|
|
on-success:
|
2021-01-06 01:53:58 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-10-12 05:11:31 +03:00
|
|
|
- name: Wait for tests to succeed
|
|
|
|
if: ${{ github.event.workflow_run.conclusion != 'success' }}
|
|
|
|
run: exit 1
|
2021-10-21 00:32:45 +03:00
|
|
|
- name: Check trigger event
|
|
|
|
if: ${{ github.event_name != 'push' }}
|
|
|
|
run: exit 0
|
2021-01-06 01:53:58 +03:00
|
|
|
- name: checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: install buildx
|
|
|
|
id: buildx
|
|
|
|
uses: crazy-max/ghaction-docker-buildx@v1
|
|
|
|
with:
|
|
|
|
version: latest
|
|
|
|
- name: log in to docker hub
|
|
|
|
run: |
|
|
|
|
echo "${{ secrets.DOCKER_PASSWORD }}" | \
|
|
|
|
docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
|
|
|
|
- name: build and push the image
|
2021-10-20 21:39:04 +03:00
|
|
|
if: startsWith(github.ref, 'refs/heads/main')
|
2021-01-06 01:53:58 +03:00
|
|
|
run: |
|
2021-03-25 17:43:05 +03:00
|
|
|
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
|
|
|
docker buildx ls
|
2021-01-06 01:53:58 +03:00
|
|
|
docker buildx build --push \
|
2021-08-24 18:38:35 +03:00
|
|
|
--tag benbusby/whoogle-search:latest \
|
2021-01-06 01:53:58 +03:00
|
|
|
--platform linux/amd64,linux/arm/v7,linux/arm64 .
|
2021-10-12 05:11:31 +03:00
|
|
|
- name: build and push tag
|
|
|
|
if: startsWith(github.ref, 'refs/tags')
|
|
|
|
run: |
|
|
|
|
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
|
|
|
docker buildx ls
|
|
|
|
docker buildx build --push \
|
|
|
|
--tag benbusby/whoogle-search:${GITHUB_REF#refs/*/v}\
|
|
|
|
--platform linux/amd64,linux/arm/v7,linux/arm64 .
|