From 073e442b4d9d2c724e8ad53ed085095eb4853903 Mon Sep 17 00:00:00 2001 From: Ole Kristian Morud Date: Mon, 15 Jan 2024 03:24:42 +0100 Subject: [PATCH] Update CI --- .github/workflows/build-image.yml | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index cba1b8c..2ca6570 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -7,7 +7,24 @@ on: jobs: build: runs-on: ubuntu-latest + permissions: + packages: write steps: - - uses: actions/checkout@v3 - - name: Build the Docker image - run: docker build . --tag papermc:$(date +%s) + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + push: true + tags: ghcr.io/${{ github.repository }} + labels: org.opencontainers.image.source=https://github.com/${{ github.repository }} + cache-from: type=gha + cache-to: type=gha,mode=max