ci: Bump release version #34
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: release-dashboard | |
on: | |
push: | |
tags: [ '*.*.*', '*.*.*-*' ] | |
env: | |
REGISTRY: docker.io | |
IMAGE_NAME: ${{ github.repository }} | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
id: qemu | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log into dockerhub | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Extract Docker metadata | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
flavor: | | |
latest=false | |
suffix=-dashboard | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: parse/. | |
file: parse/Dockerfile.dashboard | |
platforms: linux/amd64, linux/arm64/v8 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
singularity: | |
needs: docker | |
runs-on: ubuntu-latest | |
container: | |
image: quay.io/singularity/singularity:v3.11.5 | |
strategy: | |
fail-fast: false | |
matrix: | |
recipe: ["Singularity"] | |
steps: | |
- name: Check out code for the container build | |
uses: actions/checkout@v4 | |
- name: Continue if Singularity recipe exists | |
run: | | |
if [[ -f "${{ matrix.recipe }}" ]]; then | |
echo "keepgoing=true" >> $GITHUB_ENV | |
fi | |
- name: Get release version | |
run: echo "TAG=${GITHUB_REF/refs\/tags\//}-dashboard" >> $GITHUB_ENV | |
- name: Update Singularity file tag | |
run: | | |
sed -i "s/latest/$TAG/" ./Singularity | |
- name: Build Singularity image | |
env: | |
recipe: ${{ matrix.recipe }} | |
run: | | |
ls | |
if [ -f "${{ matrix.recipe }}" ]; then | |
sudo -E singularity build container.sif ${{ matrix.recipe }} | |
tag=$(echo "${recipe/Singularity\./}") | |
if [ "$tag" == "Singularity" ]; then | |
tag=$TAG | |
fi | |
# Build the container and name by tag | |
echo "Tag is $tag." | |
echo "tag=$tag" >> $GITHUB_ENV | |
else | |
echo "${{ matrix.recipe }} is not found." | |
echo "Present working directory: $PWD" | |
ls | |
fi | |
- name: Login and Deploy Container | |
env: | |
keepgoing: ${{ env.keepgoing }} | |
run: | | |
if [[ "${keepgoing}" == "true" ]]; then | |
echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ secrets.GHCR_USERNAME }} --password-stdin oras://ghcr.io | |
singularity push container.sif oras://ghcr.io/${GITHUB_REPOSITORY}:${tag} | |
fi | |