diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 3f53646..fc1386b 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -7,12 +7,20 @@ on: branches: [ "main" ] jobs: - build: - runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to GitHub Container Registry + run: echo "${{ secrets.GHCR_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin + - name: Build the Docker image - run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) + run: docker build . --file Dockerfile --tag ghcr.io/${{ github.repository_owner }}/my-image-name:latest + + - name: Push the Docker image + run: docker push ghcr.io/${{ github.repository_owner }}/my-image-name:latest