Merge pull request #17 from digitalearthafrica/update-get-dataset-ids #16
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: Push | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
- 'deafrica_conflux/**' | |
- '.github/workflows/push.yml' | |
- 'Dockerfile' | |
release: | |
types: [created, edited] | |
env: | |
IMAGE_NAME: digitalearthafrica/deafrica-conflux | |
jobs: | |
push: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get tag for this build if it exists | |
if: github.event_name == 'release' | |
run: | | |
echo "RELEASE=${GITHUB_REF/refs\/tags\/}" >> $GITHUB_ENV | |
- name: Build and Push semver tagged Docker Image for Release | |
uses: whoan/docker-build-with-cache-action@v6 | |
if: github.event_name == 'release' | |
with: | |
image_name: ${{ env.IMAGE_NAME }} | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DEAFRICA_DOCKER_PASSWORD}} | |
image_tag: ${{ env.RELEASE }} | |
- name: Get git commit hash for push to main | |
if: github.event_name != 'release' | |
run: | | |
git fetch --all --tags | |
echo "RELEASE=$(git describe --tags)" >> $GITHUB_ENV | |
- name: Build and Push unstable Docker Image for push to main | |
uses: whoan/docker-build-with-cache-action@v6 | |
if: github.event_name != 'release' | |
with: | |
image_name: ${{ env.IMAGE_NAME }} | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DEAFRICA_DOCKER_PASSWORD}} | |
image_tag: latest,${{ env.RELEASE }} |