2022-03-14 07:19:11 +01:00
|
|
|
on:
|
2022-05-17 14:31:27 +02:00
|
|
|
push:
|
2022-03-14 07:19:11 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build, push, and deploy
|
|
|
|
runs-on: ubuntu-latest
|
2022-05-17 14:31:27 +02:00
|
|
|
if: github.ref == 'refs/heads/main'
|
2022-03-14 07:19:11 +01:00
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Build container image
|
2023-11-16 23:37:00 +01:00
|
|
|
platforms: linux/amd64,linux/arm64
|
2022-03-14 07:19:11 +01:00
|
|
|
run: |
|
|
|
|
docker build \
|
2023-11-16 23:38:46 +01:00
|
|
|
--tag ghcr.io/hra42/my-idlers-arm64:$(echo $GITHUB_SHA | head -c7) \
|
|
|
|
--tag ghcr.io/hra42/my-idlers-arm64:latest \
|
2022-03-14 07:19:11 +01:00
|
|
|
.
|
|
|
|
- name: Container registry login
|
|
|
|
run: |
|
|
|
|
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
|
|
|
|
|
2022-05-17 14:31:27 +02:00
|
|
|
- name: Push image to GHCR
|
2022-03-14 07:19:11 +01:00
|
|
|
if: github.ref == 'refs/heads/main'
|
|
|
|
run: |
|
2023-11-16 23:41:33 +01:00
|
|
|
docker push ghcr.io/hra42/my-idlers-arm64:$(echo $GITHUB_SHA | head -c7)
|
|
|
|
docker push ghcr.io/hra42/my-idlers-arm64:latest
|