Merge pull request #69 from snuhcs-course/frontend/logout #35
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: Build image for backend | |
on: | |
push: | |
branches: | |
- main | |
- backend/dockerfile | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Log into GitHub Container Registry | |
run: echo "${{ secrets.GH_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
- name: Go to backend repo | |
run: | | |
cd backend | |
- name: Add SHORT_SHA | |
run: | | |
echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-7`" >> $GITHUB_ENV | |
echo ${SHORT_SHA} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Docker build & push | |
uses: docker/build-push-action@v3 | |
env: | |
SHORT_SHA: ${{ env.SHORT_SHA }} | |
with: | |
context: backend/ | |
pull: true | |
push: true | |
tags: ghcr.io/snuhcs-course/swpp-2023-project-team-8/backend:${{ env.SHORT_SHA }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |