diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index cfa24f0..2a2ef11 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,24 +1,32 @@ -name: ci +name: Docker on: push: - branches: - - 'master' jobs: docker: runs-on: ubuntu-latest + permissions: + contents: read + packages: write steps: - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to DockerHub - uses: docker/login-action@v1 + - name: Checkout repository + uses: actions/checkout@v4 + - name: Log in to the Container Registry + uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata for Docker + id: meta + uses: docker/metadata-action@v5 with: + images: ghcr.io/${{ github.repository }} + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . push: true - tags: theelves/try:latest + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}