Skip to content

Add or update the App Service deployment workflow configuration from … #124

Add or update the App Service deployment workflow configuration from …

Add or update the App Service deployment workflow configuration from … #124

Workflow file for this run

name: "Docker Image CI: websplot"
on:
push:
branches:
- main
- develop
env:
IMAGE_NAME: crawlabteam/webspot
jobs:
setup:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v2
- id: version
name: Get version
run: |
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "main" ] && VERSION=latest
echo "::set-output name=version::$VERSION"
publish:
runs-on: ubuntu-latest
needs: [ setup ]
steps:
- uses: actions/checkout@v2
- name: Build image
run: |
docker build . --file Dockerfile --tag image
- name: Log into registry
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
- name: Push image
run: |
IMAGE_VERSION=${{needs.setup.outputs.version}}
docker tag image $IMAGE_NAME:$IMAGE_VERSION
docker push $IMAGE_NAME:$IMAGE_VERSION