2024-04-14 17:49:41 -04:00
|
|
|
name: Create and publish Docker image
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
push:
|
|
|
|
paths:
|
2024-04-24 18:10:17 -04:00
|
|
|
- '**/Dockerfile'
|
|
|
|
- '.github/workflows/build-docker-image.yml'
|
2024-04-14 17:49:41 -04:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-and-push-image:
|
|
|
|
runs-on: build-set
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
packages: write
|
|
|
|
|
|
|
|
steps:
|
2024-04-24 18:10:17 -04:00
|
|
|
- name: Get checkout token
|
|
|
|
uses: actions/create-github-app-token@v1
|
|
|
|
id: app_token
|
|
|
|
with:
|
|
|
|
app-id: ${{ vars.APP_ID }}
|
|
|
|
private-key: ${{ secrets.APP_PEM }}
|
|
|
|
owner: ${{ github.repository_owner }}
|
2024-04-14 17:49:41 -04:00
|
|
|
|
2024-04-24 18:10:17 -04:00
|
|
|
- name: Checkout repo
|
|
|
|
uses: funkincrew/ci-checkout@v6
|
|
|
|
with:
|
|
|
|
submodules: false
|
|
|
|
token: ${{ steps.app_token.outputs.token }}
|
2024-04-14 17:49:41 -04:00
|
|
|
|
2024-04-24 18:10:17 -04:00
|
|
|
- name: Log into GitHub Container Registry
|
|
|
|
uses: docker/login-action@v3.1.0
|
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
2024-04-14 17:49:41 -04:00
|
|
|
|
2024-04-24 18:10:17 -04:00
|
|
|
- name: Build and push Docker image
|
|
|
|
uses: docker/build-push-action@v5.3.0
|
|
|
|
with:
|
|
|
|
context: ./build
|
|
|
|
push: true
|
|
|
|
tags: |
|
|
|
|
ghcr.io/funkincrew/build-dependencies:latest
|
|
|
|
ghcr.io/funkincrew/build-dependencies:${{ github.sha }}
|
|
|
|
labels: |
|
|
|
|
org.opencontainers.image.description=precooked haxe build-dependencies
|
|
|
|
org.opencontainers.image.revision=${{ github.sha }}
|
|
|
|
org.opencontainers.image.source=https://github.com/${{ github.repository }}
|
|
|
|
org.opencontainers.image.title=${{ github.repository_owner }}/build-dependencies
|
|
|
|
org.opencontainers.image.url=https://github.com/${{ github.repository }}
|
|
|
|
org.opencontainers.image.version=${{ github.sha }}
|