This commit is contained in:
45
.github/workflows/deploy-ui.yml
vendored
Normal file
45
.github/workflows/deploy-ui.yml
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
name: Deploy Frontend
|
||||
run-name: ${{ gitea.actor }} is deploying frontend 🚀
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: catthehacker/ubuntu:act-latest
|
||||
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Build and Push Docker Image
|
||||
run: |
|
||||
docker build \
|
||||
--build-arg NEXT_PUBLIC_API_URL='${{ secrets.NEXT_PUBLIC_API_URL }}' \
|
||||
--build-arg NEXT_PUBLIC_AUTH_REQUIRED='false' \
|
||||
-t skript-ui .
|
||||
|
||||
- name: Stop and Remove Existing Container
|
||||
run: |
|
||||
docker stop ui-skript-container || true
|
||||
docker rm ui-skript-container || true
|
||||
|
||||
- name: Run New Container
|
||||
run: |
|
||||
docker run -d \
|
||||
--name ui-skript-container \
|
||||
--restart unless-stopped \
|
||||
--network gitea-server_gitea \
|
||||
-p 1506:3000 \
|
||||
-e NEXTAUTH_URL='${{ secrets.NEXTAUTH_URL }}' \
|
||||
-e NEXTAUTH_SECRET='${{ secrets.NEXTAUTH_SECRET }}' \
|
||||
-e INTERNAL_API_URL='http://backend-skript-container:3000' \
|
||||
skript-ui
|
||||
|
||||
- name: Cleanup
|
||||
run: docker image prune -f
|
||||
Reference in New Issue
Block a user