refactor: use docker actions

This commit is contained in:
Peter Galonza 2024-05-27 00:51:54 +03:00
parent 3eb433885f
commit 04e1ea35a9

View file

@ -18,14 +18,16 @@ jobs:
contents: read
attestations: write
steps:
- uses: actions/checkout@v4
- name: Build image
run: |
docker build . --no-cache \
--file Dockerfile --tag $IMAGE_NAME --label "runnumber=${{ github.run_id }}"
- name: Log in to registry
run: docker login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
- name: Push image
run: |
docker tag $IMAGE_NAME ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME:latest
docker push ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME:latest
- 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_owner }}/${{ env.IMAGE_NAME }}:latest