Merge pull request #39 from MortenTabaka/fix/Add-script-for-adding-pr… #35
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: Docker Image CI | |
on: | |
push: | |
branches: [ "main" ] | |
jobs: | |
build_and_push: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: '0' | |
- name: Bump version and push tag | |
id: bump_tag_version | |
uses: anothrNick/github-tag-action@1.61.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
WITH_V: true | |
- name: Get latest tag of branch | |
id: get_latest_tag | |
run: echo ::set-output name=latest_tag::$(git describe --abbrev=0 --tags) | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Build and push Docker image | |
env: | |
DOCKER_BUILDKIT: 1 | |
DOCKER_TAG: ${{ steps.get_latest_tag.outputs.latest_tag }} | |
run: | | |
docker buildx build \ | |
--platform linux/amd64,linux/arm64 \ | |
--push \ | |
--tag mortentabaka/landcover_semantic_segmentation_with_deeplabv3plus:${DOCKER_TAG} \ | |
--tag mortentabaka/landcover_semantic_segmentation_with_deeplabv3plus:latest \ | |
. |