Skip to content

initial commit

initial commit #1

Workflow file for this run

name: build-images
on:
push:
jobs:
list:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- id: set-matrix
run: |
echo "matrix=$(find images -type f -name 'Dockerfile.*' | awk -F'.' '{print $2}')" >> $GITHUB_OUTPUT
push-ghcr:
name: Build and push image
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
id-token: write
strategy:
fail-fast: false
matrix:
chal: ${{ fromJson(needs.list.outputs.matrix) }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Generate variables
id: vars
run: |
echo "date=$(date +%Y-%m-%d)" >> $GITHUB_OUTPUT
- name: Login to ghcr
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Build image
run: |
docker build \
--tag ghcr.io/${{ github.repository_owner }}/tag-:${{ matrix.chal }}-${{ steps.vars.outputs.date }} \
--tag ghcr.io/${{ github.repository_owner }}/tag-:${{ matrix.chal }}-latest \
--file images/Dockerfile.${{ matrix.chal }} \
images
- name: Push to ghcr
run: |
docker push ghcr.io/${{ github.repository_owner }}/tag-:${{ matrix.chal }}-${{ steps.vars.outputs.date }}
docker push ghcr.io/${{ github.repository_owner }}/tag-:${{ matrix.chal }}-latest