From 3f47ecc65717b42fc7d4728fd3c80d00dbc0ca15 Mon Sep 17 00:00:00 2001 From: Yongun Seong Date: Sun, 25 Feb 2024 17:37:21 +0900 Subject: [PATCH] feat(ci): add builder --- .github/workflows/build.yaml | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..4a73fef --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,43 @@ +name: Build +on: + push: + branches: + - master + pull_request: + branches: + - master + +permissions: + contents: read + id-token: write + packages: write + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: docker/setup-buildx-action@v3 + - uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - uses: docker/metadata-action@v5 + id: meta + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - uses: docker/build-push-action@v5 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + annotations: ${{ steps.meta.outputs.annotations }}