Bugfix JOB_URL to env #204
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: [ push, workflow_dispatch ] | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Add variables to the GitHub environment | |
run: | | |
JOB_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" | |
echo "JOB_URL=$JOB_URL" >> "$GITHUB_ENV" | |
build: | |
if: github.event_name != 'release' | |
permissions: | |
packages: write | |
contents: read | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
platform: | |
- linux/amd64 | |
- linux/arm64 | |
fail-fast: false | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
ghcr.io/berkeleylibrary/geodata | |
labels: | | |
edu.berkeley.lib.build-timestamp=${{ github.event.repository.updated_at }} | |
edu.berkeley.lib.build-url=${{ env.JOB_URL }} | |
edu.berkeley.lib.git-ref-name=${{ github.ref_name }} | |
edu.berkeley.lib.git-repository-url=${{ github.repositoryUrl }} | |
edu.berkeley.lib.git-sha=${{ github.sha }} | |
tags: | | |
type=sha | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: false | |
build-args: | | |
BUILD_TIMESTAMP=${{ github.event.repository.updated_at }} | |
BUILD_URL=${{ env.JOB_URL }} | |
GIT_REF_NAME=${{ github.ref_name }} | |
GIT_REPOSITORY_URL=${{ github.repositoryUrl }} | |
GIT_SHA=${{ github.sha }} | |
labels: ${{ steps.meta.outputs.labels }} | |
tags: ${{ steps.meta.outputs.tags }} |