Skip to content

Commit

Permalink
updated docker workflow actions versions, added canary build
Browse files Browse the repository at this point in the history
  • Loading branch information
rongxin-liu committed May 29, 2024
1 parent da3eef5 commit 7985a1b
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ jobs:
uses: actions/checkout@v4

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

- name: Log into Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Log into GitHub Packages
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down Expand Up @@ -57,8 +57,16 @@ jobs:
docker push cs50/codespace:${{ github.sha }}
docker push cs50/codespace:latest
- name: Build ${{ github.ref_name}}
if: ${{ github.ref != 'refs/heads/main' }}
- name: Build (canary)
if: ${{ github.ref == 'refs/heads/canary' }}
run: |
export TAG=canary
export VCS_REF=$(git rev-parse HEAD)
npm install -g @devcontainers/cli
devcontainer build --workspace-folder . --config devcontainer.json --image-name cs50/codespace:${{ github.sha }} --image-name cs50/codespace:${{ github.ref_name }}
- name: Build (${{ github.ref_name}})
if: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/canary' }}
run: |
export TAG=amd64
export VCS_REF=$(git rev-parse HEAD)
Expand Down Expand Up @@ -86,7 +94,7 @@ jobs:
- name: Tag main as latest
if: ${{ github.ref == 'refs/heads/main' }}
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
github-token: ${{ github.token }}
script: |
Expand Down

0 comments on commit 7985a1b

Please sign in to comment.