2021-01-05 22:53:58 +00:00
|
|
|
name: buildx
|
|
|
|
|
|
|
|
on:
|
2021-10-12 02:11:31 +00:00
|
|
|
workflow_run:
|
2022-01-25 18:42:29 +00:00
|
|
|
workflows: ["docker_main"]
|
2021-10-12 02:11:31 +00:00
|
|
|
branches: [main]
|
|
|
|
types:
|
|
|
|
- completed
|
2022-02-01 17:55:41 +00:00
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- '*'
|
2021-01-05 22:53:58 +00:00
|
|
|
|
|
|
|
jobs:
|
2021-10-12 02:11:31 +00:00
|
|
|
on-success:
|
2021-01-05 22:53:58 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-10-12 02:11:31 +00:00
|
|
|
- name: Wait for tests to succeed
|
|
|
|
if: ${{ github.event.workflow_run.conclusion != 'success' }}
|
|
|
|
run: exit 1
|
2021-01-05 22:53:58 +00:00
|
|
|
- name: checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: install buildx
|
|
|
|
id: buildx
|
|
|
|
uses: crazy-max/ghaction-docker-buildx@v1
|
|
|
|
with:
|
|
|
|
version: latest
|
2022-02-02 01:02:59 +00:00
|
|
|
- name: Login to Docker Hub
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Login to ghcr.io
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
2021-01-05 22:53:58 +00:00
|
|
|
- name: build and push the image
|
2021-10-21 02:41:04 +00:00
|
|
|
if: startsWith(github.ref, 'refs/heads/main') && github.actor == 'benbusby'
|
2021-01-05 22:53:58 +00:00
|
|
|
run: |
|
2021-03-25 14:43:05 +00:00
|
|
|
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
|
|
|
docker buildx ls
|
2021-01-05 22:53:58 +00:00
|
|
|
docker buildx build --push \
|
2021-08-24 15:38:35 +00:00
|
|
|
--tag benbusby/whoogle-search:latest \
|
2021-01-05 22:53:58 +00:00
|
|
|
--platform linux/amd64,linux/arm/v7,linux/arm64 .
|
2022-02-02 01:02:59 +00:00
|
|
|
docker buildx build --push \
|
|
|
|
--tag ghcr.io/benbusby/whoogle-search:latest \
|
|
|
|
--platform linux/amd64,linux/arm/v7,linux/arm64 .
|
2021-10-12 02:11:31 +00: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 .
|
2022-02-02 01:02:59 +00:00
|
|
|
docker buildx build --push \
|
|
|
|
--tag ghcr.io/benbusby/whoogle-search:${GITHUB_REF#refs/*/v}\
|
|
|
|
--platform linux/amd64,linux/arm/v7,linux/arm64 .
|