Attempt to build on GitHub ubuntu-latest instead of self-hosted #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
schedule: | |
- cron: "15 9 6,13,20,27 * *" | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
workflow_dispatch: | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
# This is used to complete the identity challenge | |
# with sigstore/fulcio when running outside of PRs. | |
id-token: write | |
steps: | |
- name: Maximize build space | |
uses: easimon/maximize-build-space@master | |
# Alternatively, simply rm; see https://github.com/docker/build-push-action/blob/master/TROUBLESHOOTING.md#image-not-loaded | |
with: | |
remove-dotnet: "true" | |
remove-android: "true" | |
remove-haskell: "true" | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# Set up BuildKit Docker container builder to be able to build multi-platform images and export cache | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
# Login against a Docker registry | |
- name: Log into registry ${{ env.REGISTRY }} | |
if: ${{ github.event_name != 'pull_request' }} | |
uses: docker/[email protected] | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# Extract metadata (tags, labels) for Docker | |
- name: Extract Docker metadata | |
id: meta | |
uses: docker/[email protected] | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
# Run Containers build (required BEFORE subsequent docker build -f Dockerfile-fedora) | |
- name: Build containers | |
run: container/build.sh | |
- name: Push container image | |
if: ${{ github.event_name != 'pull_request' }} | |
run: docker push ghcr.io/vorburger/dotfiles-fedora |