Skip to content

Commit

Permalink
Merge branch 'main' into launch
Browse files Browse the repository at this point in the history
  • Loading branch information
yutotakano committed Dec 1, 2024
2 parents 5699a70 + bd490f9 commit e64cc59
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
SERVICE_NAME=adventure
SUBDOMAIN=aoc
10 changes: 5 additions & 5 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Docker
on:
workflow_dispatch:
push:
# Publish `master` as Docker `latest` image.
# Publish `main` as Docker `latest` image.
branches:
- main

Expand All @@ -19,17 +19,17 @@ jobs:
- name: Build image
run: |
source .env
docker build . --file Dockerfile --tag service-$SERVICE_NAME
docker build . --file Dockerfile --tag service-${SERVICE_NAME}
- name: Log into registry
run: echo "${{ secrets.PAT }}" | docker login ghcr.io -u compsoc-service --password-stdin

- name: Push image
run: |
source .env
IMAGE_ID=ghcr.io/compsoc-edinburgh/service-$SERVICE_NAME
docker tag service-$SERVICE_NAME $IMAGE_ID:latest
docker tag service-$SERVICE_NAME $IMAGE_ID:${{ github.sha }}
IMAGE_ID=ghcr.io/compsoc-edinburgh/service-${SERVICE_NAME}
docker tag service-${SERVICE_NAME} $IMAGE_ID:latest
docker tag service-${SERVICE_NAME} $IMAGE_ID:${{ github.sha }}
docker push $IMAGE_ID:${{ github.sha }}
docker push $IMAGE_ID:latest
- name: Trigger update
Expand Down
1 change: 1 addition & 0 deletions .open-port
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
46651
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ sync-secrets-confirm:

# After cloning this repo locally, you can run this to set up the .secrets
# directory both locally and remotely. Harmless even if run multiple times.
initialise: initialise-confirm
initialise: initialise-confirm generate-port
rsync -r ${REMOTE}:/secrets/service-${SERVICE_NAME}/ ./.secrets/

generate-port:
Expand All @@ -46,12 +46,10 @@ start:
ssh ${REMOTE} 'docker run -d --name service-${SERVICE_NAME} \
--network traefik-net \
--label "traefik.enable=true" \
-p ${PORT}:${PORT} \
--env-file /secrets/service-${SERVICE_NAME}/.env \
-p ${PORT}:8080 \
--volume /deployment/service-${SERVICE_NAME}:/etc/${SERVICE_NAME} \
--label "com.centurylinklabs.watchtower.enable=true" \
--label "traefik.http.routers.service-${SERVICE_NAME}.rule=Host(\`${SUBDOMAIN}.dev.comp-soc.com\`)" \
--label "traefik.http.routers.service-${SERVICE_NAME}.middlewares=traefik-forward-auth-gh" \
ghcr.io/compsoc-edinburgh/service-${SERVICE_NAME}'

# Most used command, restarts the service after syncing secrets (i.e. new
Expand Down

0 comments on commit e64cc59

Please sign in to comment.