Skip to content

build

build #109

Workflow file for this run

name: build
on:
schedule:
- cron: "0 0 * * 1"
push:
branches:
- main
paths-ignore: # don't rebuild if only documentation has changed
- "**.md"
workflow_dispatch:
env:
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
# Only deploys the branch named "live". Ignores all other branches, to allow
# having "development" branches without interfering with GHCR image uploads.
jobs:
push_to_registry:
name: Push image to GitHub Packages
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: true
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: set lower case owner name
run: |
echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV}
env:
OWNER: '${{ github.repository_owner }}'
- name: Log in to GitHub Docker Registry
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
registry: docker.pkg.github.com
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
push: true
tags: |
docker.pkg.github.com/${{ env.OWNER_LC }}/datblygiad/datblygiad:${{ github.sha }}
docker.pkg.github.com/${{ env.OWNER_LC }}/datblygiad/datblygiad:${{ steps.date.outputs.date }}
docker.pkg.github.com/${{ env.OWNER_LC }}/datblygiad/datblygiad:latest