Update gitignore for sqlite3 and remove unecessary pdf file #12
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 | |
on: | |
push: | |
branches: | |
- master | |
- develop | |
tags: | |
- '*' | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
# sonarcloud: | |
# name: SonarCloud | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v3 | |
# with: | |
# fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
# - name: SonarCloud Scan | |
# uses: SonarSource/sonarcloud-github-action@master | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
registry: "registry.sireto.io" | |
username: ${{ secrets.REGISTRY_USERNAME }} | |
password: ${{ secrets.REGISTRY_PASSWORD }} | |
- | |
name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./delta-pdf-api | |
push: true | |
tags: | | |
registry.sireto.io/deltalender/delta-pdf-api:${{ github.sha }} | |
${{ format('registry.sireto.io/deltalender/delta-pdf-api:{0}', github.ref_name == 'master' && 'latest' || github.ref_name ) }} | |
deploy: | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Update docker service over ssh | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.SIRETO_BASTION_HOST }} | |
username: githubci | |
key: ${{ secrets.SIRETO_BASTION_SSH_KEY }} | |
port: ${{ secrets.SIRETO_BASTION_PORT }} | |
script: | | |
if [ ${{ github.ref_name }} == 'master' ]; then | |
docker --host=${{ secrets.PROD_DEPLOYMENT_HOST }} service update --image=registry.sireto.io/deltalender/delta-pdf-api:${{ github.ref_name }} delta_sign_api | |
elif [ ${{ github.ref_name }} == 'develop' ]; then | |
docker --host=${{ secrets.DEV_DEPLOYMENT_HOST }} service update --image=registry.sireto.io/deltalender/delta-pdf-api:${{ github.sha }} delta_sign_dev_api | |
else | |
echo "Deployment skipped for branch ${{ github.ref }}" | |
fi |