Skip to content

prog1-environment

prog1-environment #5

name: prog1-environment
on: [ workflow_dispatch ]
env:
IMAGE_NAME: prog1-environment
#set tagname
TAG_NAME: latest
#set targetdir
TARGET_DIR: ./
jobs:
# Push image to GitHub Packages.
# See also https://docs.docker.com/docker-hub/builds/
push:
# Ensure test job passes before pushing image.
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.ACTOR }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: linux/amd64,linux/arm64/v8
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
version: latest
driver-opts: network=host
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: ${{ env.TAG_NAME }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ${{ env.TARGET_DIR }}
platforms: linux/amd64,linux/arm64/v8
push: true
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max