Merge pull request #9 from kaakaww/output-commit-urls #29
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: Dockerize Contrib Scripts | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
REGISTRY: ghcr.io | |
META_TAGS: | | |
# set latest tag for default branch | |
type=raw,value=latest,enable={{is_default_branch}} | |
type=schedule | |
type=ref,event=branch | |
type=ref,event=tag | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
type=sha | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Dump environment (troubleshooting) | |
run: env | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Log in to the GitHub container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for contributors-github image | |
id: contributors-github | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
${{ env.REGISTRY }}/kaakaww/contributors-github | |
tags: ${{ env.META_TAGS }} | |
- name: Build and push contributors-github image | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
target: contributors-github | |
platforms: linux/amd64,linux/arm64/v8 | |
push: true | |
tags: ${{ steps.contributors-github.outputs.tags }} | |
labels: ${{ steps.contributors-github.outputs.labels }} | |
- name: Extract metadata (tags, labels) for contributors-local image | |
id: contributors-local | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
${{ env.REGISTRY }}/kaakaww/contributors-local | |
tags: ${{ env.META_TAGS }} | |
- name: Build and push contributors-local image | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
target: contributors-local | |
platforms: linux/amd64,linux/arm64/v8 | |
push: true | |
tags: ${{ steps.contributors-local.outputs.tags }} | |
labels: ${{ steps.contributors-local.outputs.labels }} |