Allow geo.txt files to be uploaded to new task #203
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 and Publish Docker Image | |
#Following this to enable test before push: | |
# https://docs.docker.com/build/ci/github-actions/test-before-push/ | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
release: | |
types: [published] | |
jobs: | |
build: | |
name: Build and push Docker image to GitHub Packages | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
- name: Add SHORT_SHA env property with commit short sha | |
run: echo "SHORT_SHA=`git rev-parse --short HEAD`" >> $GITHUB_ENV | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
# list of Docker images to use as base name for tags | |
images: | | |
ghcr.io/auscalabledronecloud/asdc-webodm | |
# generate Docker tags based on the following events/attributes | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=sha | |
${{ env.SHORT_SHA }}-${{ github.run_number }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
driver: docker # defaults to "docker-containerized" | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and export base image to Docker | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: Dockerfile | |
load: true | |
push: false | |
tags: webodm-base | |
- name: Build and export test image to Docker | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: Dockerfile.test | |
push: false | |
pull: false | |
tags: webodm-test | |
- name: Set Swap Space | |
uses: pierotofy/set-swap-space@master | |
with: | |
swap-size-gb: 12 | |
- name: Test | |
run: | | |
docker inspect webodm-test | |
docker-compose -f docker-compose.yml -f docker-compose.test.yml up -d | |
sleep 20 | |
docker-compose exec -T webapp /webodm/webodm.sh test | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
push: true | |
tags: | | |
ghcr.io/auscalabledronecloud/asdc-webodm:latest | |
${{ steps.meta.outputs.tags }} | |