fix #24
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: Go Backend CI/CD | |
on: | |
push: | |
branches: ["main"] | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build Prod Docker Image | |
run: docker build -t jokil/esefexapi:latest -f EsefexApi/Dockerfile EsefexApi | |
- name: Push Docker Image | |
run: docker push jokil/esefexapi:latest | |
# - name: Deploy to production | |
# uses: appleboy/[email protected] | |
# with: | |
# host: ${{ vars.HOST }} | |
# username: ${{ vars.USERNAME }} | |
# key: ${{ secrets.SSH_KEY }} | |
# script: | | |
# cd api | |
# docker compose down | |
# > .env.github | |
# echo BOT_TOKEN=${{ secrets.BOT_TOKEN }} >> .env.github | |
# echo DOMAIN=${{ vars.DOMAIN }} >> .env.github | |
# docker compose pull | |
# docker compose up -d |