fix: point to correct upstream image and login to GHCR before push (#9) #372
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 Images | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: "0 */12 * * *" | |
workflow_dispatch: | |
env: | |
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
fedora-version: [41] | |
desktop-environment: [cosmic] | |
permissions: | |
contents: read | |
packages: write | |
id-token: write | |
env: | |
IMAGE_NAME: eternal-linux/base/fedora-${{ matrix.desktop-environment }} | |
FEDORA_VERSION: ${{ matrix.fedora-version }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Generate Image Tags | |
uses: rsturla/eternal-main/.github/actions/generate-image-tags@main | |
id: generate-image-tags | |
with: | |
image-name: ${{ env.IMAGE_REGISTRY}}/${{ env.IMAGE_NAME }} | |
major-version: ${{ env.FEDORA_VERSION }} | |
is-release: ${{ github.event_name != 'pull_request' }} | |
- name: Login to GHCR | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
- name: Build Image | |
id: build | |
uses: rsturla/eternal-main/.github/actions/build-image@main | |
with: | |
builder: docker | |
context: ./desktop-environments/${{ matrix.desktop-environment }} | |
dockerfile: ./desktop-environments/${{ matrix.desktop-environment }}/Containerfile | |
image-name: ${{ env.IMAGE_NAME }} | |
image-tags: | | |
${{ steps.generate-image-tags.outputs.tags }} | |
build-args: | | |
FEDORA_VERSION=${{ env.FEDORA_VERSION }} | |
- name: Push Image | |
id: push | |
uses: rsturla/eternal-main/.github/actions/push-image@main | |
with: | |
builder: ${{ steps.build.outputs.builder }} | |
image-name: ${{ steps.build.outputs.image }} | |
image-tags: ${{ steps.build.outputs.tags }} | |
image-registry: ${{ env.IMAGE_REGISTRY }} |