diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index a5c802a..e486700 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,4 +1,4 @@ -name: Docker Image CI +name: Docker on: push: @@ -7,12 +7,28 @@ on: branches: [ "dev" ] jobs: - build: + name: Build image runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Build the Docker image - run: docker build . --file Dockerfile --tag nollk-it:githubtest + - + uses: actions/checkout@v3 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Login to GitHub Container Registry + if: ${{ github.ref == 'refs/heads/dev' }} + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Build Docker image (and push on dev) + uses: docker/build-push-action@v4.0.0 + with: + push: ${{ github.ref == 'refs/heads/dev' }} + tags: ghcr.io/cthit/nollk.it:latest