ci(fix): lowercase #41
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: CI/CD Pipeline | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build Docker image | |
run: docker build -t ghcr.io/sn0wye/caho-api:$GITHUB_SHA . | |
- name: Tag Docker image (SHA Tag) | |
run: docker tag ghcr.io/sn0wye/caho-api:$GITHUB_SHA ghcr.io/sn0wye/caho-api:$GITHUB_SHA | |
- name: Tag Docker image (Latest Tag) | |
run: docker tag ghcr.io/sn0wye/caho-api:$GITHUB_SHA ghcr.io/sn0wye/caho-api:latest | |
- name: Push Docker image to GitHub Container Registry (SHA Tag) | |
run: docker push ghcr.io/sn0wye/caho-api:$GITHUB_SHA | |
- name: Push Docker image to GitHub Container Registry (Latest Tag) | |
run: docker push ghcr.io/sn0wye/caho-api:latest | |
- name: SSH and Deploy | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.SERVER_HOST }} | |
username: ${{ secrets.SERVER_USERNAME }} | |
key: ${{ secrets.SERVER_SSH_KEY }} | |
passphrase: ${{ secrets.SERVER_PASSPHRASE }} | |
script: | | |
./caho/scripts/deploy.sh caho-api $GITHUB_SHA ghcr.io/sn0wye/caho-api |