Skip to content

Merge pull request #246 from thanhdanh27600/dev #242

Merge pull request #246 from thanhdanh27600/dev

Merge pull request #246 from thanhdanh27600/dev #242

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CD-PRODUCTION
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [production]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Decrypt secret
run: ./scripts/decrypt_secret.sh .env.production.gpg ./.env
env:
SECRET_PASSPHRASE: ${{ secrets.SECRET_PASSPHRASE }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
build-args: |
"GEOLITE2_LICENSE_KEY=${{ secrets.GEOLITE2_LICENSE_KEY }}"
NEXT_PUBLIC_SHORT_DOMAIN=false
push: true
tags: ghcr.io/${{ github.repository }}:latest
# deploy:
# needs: build
# runs-on: ubuntu-latest
# steps:
# - name: Deploy using ssh
# uses: appleboy/ssh-action@master
# with:
# host: ${{ secrets.HOST }}
# username: ${{ secrets.USERNAME }}
# password: ${{ secrets.PASSWORD }}
# port: 22
# script: |
# cd ~/clickdi
# # sh ./backup.sh
# sudo docker login -u ${{ github.repository_owner }} -p ${{ secrets.GITHUB_TOKEN }}
# sudo docker compose down
# sudo docker compose pull
# sudo docker compose up -d
# sudo sh ./migrate.sh
# sudo sh ./puppeteer.sh
# sudo docker system prune -f
# deploy:
# runs-on: ubuntu-latest
# needs: build
# environment:
# name: 'production'
# url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
# steps:
# - name: Deploy to Azure Web App
# id: deploy-to-webapp
# uses: azure/webapps-deploy@v2
# with:
# app-name: 'quickshare'
# slot-name: 'production'
# publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_QUICKSHARE }}