Skip to content

- block sick vacation type for employees (#362) #23

- block sick vacation type for employees (#362)

- block sick vacation type for employees (#362) #23

Workflow file for this run

name: Deploy to production
concurrency:
group: deploy-prod
cancel-in-progress: false
on:
push:
tags:
- v*
jobs:
deploy:
environment: production
runs-on: ubuntu-22.04
name: Deploy to production
env:
REPO_NAME: toby
steps:
- name: checkout
uses: actions/checkout@v4
- name: set deployment project version
run: echo "DEPLOYMENT_PROJECT_VERSION=$(bash ./environment/prod/deployment/scripts/version.sh --long)" >> $GITHUB_ENV
- name: set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ env.REPO_NAME }}
tags: |
type=raw,value=latest
type=raw,value=${{ github.ref_name }}
context: workflow
- name: build and push image
uses: docker/build-push-action@v5
with:
context: .
file: ./environment/prod/app/Dockerfile
build-args: DEPLOYMENT_PROJECT_VERSION_ARG=${{ env.DEPLOYMENT_PROJECT_VERSION }}
labels: ${{ steps.meta.outputs.labels }}
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/${{ env.REPO_NAME }}:latest
ghcr.io/${{ github.repository_owner }}/${{ env.REPO_NAME }}:${{ github.ref_name }}
cache-from: type=gha, ref=ghcr.io/${{ github.repository_owner }}/${{ env.REPO_NAME }}-prod-build-cache
cache-to: type=gha, ref=ghcr.io/${{ github.repository_owner }}/${{ env.REPO_NAME }}-prod-build-cache, mode=max
- name: copy files via ssh
uses: appleboy/[email protected]
with:
timeout: 10s
command_timeout: 10m
host: ${{ secrets.VPS_OVH_BF7EC892_HOST }}
port: ${{ secrets.VPS_OVH_BF7EC892_PORT }}
username: ${{ secrets.VPS_OVH_BF7EC892_USERNAME }}
key: ${{ secrets.VPS_OVH_BF7EC892_SSH_PRIVATE_KEY }}
passphrase: ${{ secrets.VPS_OVH_BF7EC892_SSH_PRIVATE_KEY_PASSPHRASE }}
source: "./environment/prod/deployment/prod/*,./environment/prod/deployment/scripts/*"
target: ${{ secrets.TOBY_VPS_LIVE_APP_PATH }}
rm: true
- uses: appleboy/[email protected]
with:
timeout: 10s
command_timeout: 10m
host: ${{ secrets.VPS_OVH_BF7EC892_HOST }}
port: ${{ secrets.VPS_OVH_BF7EC892_PORT }}
username: ${{ secrets.VPS_OVH_BF7EC892_USERNAME }}
key: ${{ secrets.VPS_OVH_BF7EC892_SSH_PRIVATE_KEY }}
passphrase: ${{ secrets.VPS_OVH_BF7EC892_SSH_PRIVATE_KEY_PASSPHRASE }}
script_stop: true
script: |
cd ${{ secrets.TOBY_VPS_LIVE_APP_PATH }}/environment/prod/deployment/prod
make prod-deploy PROD_ENV_KEY=${{ secrets.PROD_ENV_KEY }}
docker images --filter dangling=true | grep "ghcr.io/blumilksoftware/${{ env.REPO_NAME }}" | awk '{print $3}'| xargs --no-run-if-empty docker rmi