Merge pull request #1338 from SURFnet/feature/62_tablefilter #1715
Workflow file for this run
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 docker container for the SP Dashboard | |
on: | |
pull_request: | |
push: | |
tags: | |
- "*.*.*" | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
permissions: | |
packages: write | |
contents: write | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Get commit details for the tag from the latest release | |
id: commit_details | |
run: | | |
echo "sha=$(git rev-list -n 1 ${{ steps.release.outputs.tag_name }})" >> $GITHUB_OUTPUT | |
echo "commit_time=$(git show -s --format=%ci ${{ steps.release.outputs.tag_name }})" >> $GITHUB_OUTPUT | |
echo "ref_name=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set docker metadata for the container | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
ghcr.io/surfnet/sp-dashboard/spdashboard | |
tags: | | |
type=ref,event=tag | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
- name: Build the container and push to GitHub Packages | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
build-args: | | |
APP_VERSION=${{ steps.commit_details.outputs.ref_name }} | |
GIT_SHA=${{ steps.commit_details.outputs.sha }} | |
GIT_COMMIT_TIME=${{ steps.commit_details.outputs.commit_time }} | |
file: docker/Dockerfile | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
generate_release_notes: true | |
if: startsWith(github.ref, 'refs/tags/') | |