Skip to content

Commit

Permalink
Adding a build step in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mhmdksh committed Jun 21, 2024
1 parent aa24490 commit c2618a5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
27 changes: 24 additions & 3 deletions .github/workflows/staging-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,30 @@ on:
- staging

jobs:
publish:
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: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ghcr.io/GeneralMagicio/pw-backend:staging

deploy:
needs: publish
runs-on: ubuntu-latest
steps:
- name: SSH and Redeploy Staging
Expand All @@ -20,6 +43,4 @@ jobs:
cd rpgf4-pw-backend
docker-compose down -v
docker image prune -a --force
git checkout staging
git pull origin staging
docker-compose up -d --build
docker-compose up -d
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ version: '3'

services:
pw-backend:
build:
context: .
image: ghcr.io/GeneralMagicio/pw-backend:staging
container_name: rpgf4-pw-backend
restart: always
ports:
Expand Down

0 comments on commit c2618a5

Please sign in to comment.