Skip to content

Commit b630b3c

Browse files
committed
build: rename docker files and prepare for github registry push
1 parent ade293b commit b630b3c

File tree

5 files changed

+15
-20
lines changed

5 files changed

+15
-20
lines changed

.github/workflows/ci_fast.yaml

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,38 +36,31 @@ jobs:
3636
name: website
3737
path: ./public
3838

39-
- name: Configure AWS credentials
40-
uses: aws-actions/configure-aws-credentials@v1
39+
- name: Login to GitHub Container Registry
40+
uses: docker/login-action@v1
4141
with:
42-
aws-access-key-id: ${{ secrets.DELPHI_ECR_ACCESS_ID }}
43-
aws-secret-access-key: ${{ secrets.DELPHI_ECR_ACCESS_KEY }}
44-
aws-region: us-east-1
42+
registry: ghcr.io
43+
username: ${{ secrets.CR_USER }}
44+
password: ${{ secrets.CR_PAT }}
4545

46-
- name: Login to Amazon ECR
47-
id: login-ecr
48-
uses: aws-actions/amazon-ecr-login@v1
49-
50-
- name: Build, tag, and push image to Amazon ECR
51-
env:
52-
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
53-
ECR_REPOSITORY: ${{ github.event.repository.name }}
46+
- name: Build, tag, and push image to Github
5447
run: |
5548
baseRef="${GITHUB_REF#*/}"
5649
baseRef="${baseRef#*/}"
5750
case "${baseRef}" in
5851
main)
59-
awsTag="latest"
52+
imageTag="latest"
6053
;;
6154
*)
62-
awsTag="${baseRef//\//_}" # replace `/` with `_` in branch name
55+
imageTag="${baseRef//\//_}" # replace `/` with `_` in branch name
6356
;;
6457
esac
65-
echo "using tag: --${awsTag}--"
66-
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$awsTag --file ./devops/precompiled/Dockerfile .
67-
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$awsTag
58+
echo "using tag: --${imageTag}--"
59+
docker build -t ghcr.io/cmu-delphi/www-main:$imageTag --file ./devops/precompiled.dockerfile .
60+
docker push ghcr.io/cmu-delphi/www-main:$imageTag
6861
6962
# trigger a webhook update
7063
curl -H "Authorization: Bearer ${{ secrets.DELPHI_DEPLOY_WEBHOOK_TOKEN }}" \
7164
-X POST ${{ secrets.DELPHI_DEPLOY_WEBHOOK_URL }} \
7265
-H "Content-Type: application/x-www-form-urlencoded" \
73-
-d "repository=$ECR_REGISTRY/$ECR_REPOSITORY&tag=$awsTag"
66+
-d "repository=ghcr.io/cmu-delphi/www-main&tag=$imageTag"

devops/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ RUN npm ci --unsafe-perm
66
RUN npm run build
77

88
FROM nginx:stable-alpine
9+
LABEL org.opencontainers.image.source=https://github.com/cmu-delphi/www-main
910
COPY --from=builder /src/public /usr/share/nginx/html
1011
# ensure files are readable at runtime
1112
RUN chmod o+r -R /usr/share/nginx/html/

devops/precompiled/Dockerfile renamed to devops/precompiled.dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# docker image using the current built website
22
FROM nginx:stable-alpine
3+
LABEL org.opencontainers.image.source=https://github.com/cmu-delphi/www-main
34

45
COPY ./public /usr/share/nginx/html
56
# ensure files are readable at runtime
File renamed without changes.

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services:
55
r:
66
build:
77
context: .
8-
dockerfile: devops/r/Dockerfile
8+
dockerfile: devops/r.dockerfile
99
working_dir: "/app"
1010
command: tail -F anything
1111
volumes:

0 commit comments

Comments
 (0)