Skip to content

xcube docker build

xcube docker build #7

name: xcube docker build
on:
workflow_dispatch:
env:
APP_NAME: xcube
ORG_NAME: bcdev
IMG_REG_NAME: quay.io
jobs:
build-docker-image-and-push:
runs-on: ubuntu-latest
# Build the docker image and push to quay.io
name: build-docker-image
steps:
# Determine latest release tag
- name: Get latest release
id: latest_release
run: |
LATEST_RELEASE=$(curl --silent "https://api.github.com/repos/dcs4cop/xcube/releases/latest" | jq -r .tag_name)
echo "::set-output name=release_tag::$LATEST_RELEASE"
# checkout the repo with the release tag from previous step
- name: git-checkout
uses: actions/checkout@v2
with:
ref: ${{ steps.latest_release.outputs.release_tag }}
# Print some info
- name: info
id: info
run: |
echo "TAG: ${{ steps.latest_release.outputs.release_tag }}"
echo "EVENT: ${{ github.event_name }}"
# Build and push docker release to quay.io
- name: push-docker-image-with-release-tag
uses: mr-smithers-excellent/docker-build-push@v5
with:
image: ${{ env.ORG_NAME }}/${{ env.APP_NAME }}
tags: ${{ steps.latest_release.outputs.release_tag }}
registry: ${{ env.IMG_REG_NAME }}
username: ${{ secrets.IMG_REG_USERNAME }}
password: ${{ secrets.IMG_REG_PASSWORD }}