Less aggressive language selection (#417) #62
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 build, push and deploy" | |
on: | |
push: | |
branches: [ master ] | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build and push Docker image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 10 | |
- name: Login to ghcr repository | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ secrets.GH_USERNAME }} | |
password: ${{ secrets.GH_ACCESS_TOKEN }} | |
- name: Prepare version info | |
run: | | |
echo "LATEST_COMMIT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
- name: Write version file | |
run: echo "${{ env.LATEST_COMMIT_SHA }}" > version.txt | |
- name: Build and push Docker images | |
uses: docker/[email protected] | |
with: | |
context: . | |
file: ./Dockerfile | |
tags: | | |
ghcr.io/studentiunimi/website:${{ env.LATEST_COMMIT_SHA }} | |
ghcr.io/studentiunimi/website:latest | |
push: true | |
deploy: | |
name: Deploy swarm service | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Send portainer webhook | |
run: curl -X POST "${{ secrets.WEBSITE_DEPLOY_URL }}" |