fix: docker login user name #350
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: main | |
on: | |
push: | |
branches: | |
- main | |
- master | |
pull_request: | |
branches: | |
- main | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Bun | |
uses: oven-sh/setup-bun@v2 | |
- name: bun install | |
run: bun install | |
- name: types | |
run: bun run types | |
- name: eslint | |
run: bun run lint | |
docker: | |
environment: test | |
needs: build | |
if: github.ref != 'refs/heads/master' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Github Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: catHD | |
password: ${{ secrets.ghcr_token }} | |
- name: Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
push: true | |
tags: | | |
ghcr.io/cathd/${{ secrets.IMAGE_NAME }}:latest | |
build-prod-container: | |
environment: prod | |
needs: build | |
if: github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Github Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: catHD | |
password: ${{ secrets.ghcr_token }} | |
- name: Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
push: true | |
tags: | | |
ghcr.io/cathd/${{ secrets.IMAGE_NAME }}:latest | |