Skip to content

Commit

Permalink
cd: add action workflow script to deploy server
Browse files Browse the repository at this point in the history
  • Loading branch information
edwinkys committed Oct 28, 2024
1 parent 211a003 commit 4518e0f
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 4 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/dashboard-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Build Docker Image
run: |
docker build -t $NAME:$VERSION ./dashboard
run: docker build -t $NAME:$VERSION ./dashboard

- name: Push Docker Image to GHCR
run: |
docker push $NAME:$VERSION
run: docker push $NAME:$VERSION
50 changes: 50 additions & 0 deletions .github/workflows/server-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Server CD

on:
workflow_dispatch:

permissions:
contents: read
packages: write

env:
NAME: ghcr.io/phantasmlabs/phantasm/server

jobs:
publish-image:
environment: Server
name: Publish Docker Image
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Install Rust Toolchain
uses: dtolnay/rust-toolchain@stable

- name: Install Protobuf Compiler
run: |
sudo apt update && sudo apt upgrade -y
sudo apt install -y protobuf-compiler libprotobuf-dev
- name: Get Package Version
run: |
VERSION=$(cargo run -- -V | awk '{print $2}')
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Log in to GitHub Container Registry
run: echo $PASSWORD | docker login ghcr.io -u $USER --password-stdin
env:
USER: ${{ github.actor }}
PASSWORD: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Docker Image
run: |
docker build -t $NAME:$VERSION .
- name: Push Docker Image to GHCR
run: |
docker push $NAME:$VERSION

0 comments on commit 4518e0f

Please sign in to comment.