Skip to content

Merge branch 'rewards-209' into 'main' #33

Merge branch 'rewards-209' into 'main'

Merge branch 'rewards-209' into 'main' #33

Workflow file for this run

name: container-images
on:
push:
branches: [ "main" ]
tags: [ "v*" ]
jobs:
build-container-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- run: echo "IMAGE_TAG=latest" >> $GITHUB_ENV
if: github.ref_name == 'main'
- run: echo "IMAGE_TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV
if: startsWith(github.ref, 'refs/tags/v')
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: set lower case repository
run: |
echo "REPOSITORY_LC=${REPOSITORY,,}" >>${GITHUB_ENV}
env:
REPOSITORY: '${{ github.repository }}'
- name: Build and push default image
uses: docker/build-push-action@v5
with:
context: . # Because GH actions are for kids and put protection on everything; https://stackoverflow.com/a/71159809/11276254
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/${{ env.REPOSITORY_LC }}:${{ env.IMAGE_TAG }}