diff --git a/.github/workflows/create_container.yaml b/.github/workflows/create_container.yaml new file mode 100644 index 0000000..f4aab73 --- /dev/null +++ b/.github/workflows/create_container.yaml @@ -0,0 +1,53 @@ +name: create container +on: + push: + branches: + - master + - main + pull_request: + branches: + - master + - main + paths-ignore: + - "**.md" + +jobs: + build-api: + timeout-minutes: 10 + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + pull-requests: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set envs + run: | + echo "GITHUB_REPO=$(echo ${GITHUB_REPOSITORY})" >> $GITHUB_ENV + echo "GITHUB_REF_NAME=$(echo ${GITHUB_REF_NAME##*/})" >> $GITHUB_ENV + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io/dhtech + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/amd64 + no-cache: true + file: ./Dockerfile + push: true + tags: | + ghcr.io/${{ env.GITHUB_REPO }}:${{ env.GITHUB_REF_NAME }} diff --git a/Dockerfile b/Dockerfile index ca28e7a..ee6735a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM centos:7 +FROM rockylinux:8 MAINTAINER Sebastian Svensson