Skip to content

use GITHUB_TOKEN for auth #10

use GITHUB_TOKEN for auth

use GITHUB_TOKEN for auth #10

name: Build and Push Docker Image
on:
push:
branches:
- master
jobs:
build-and-push:
strategy:
matrix:
IMAGE_TAG:
- msvc
# - gcc-4.8
# - latest
runs-on: ubuntu-latest
steps:
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: DFHack-Urist
password: ${{ secrets.GITHUB_TOKEN }}
# From https://github.com/docker/build-push-action#git-context
# Setting up Docker Buildx with docker-container driver is required
# at the moment to be able to use a subdirectory with Git context
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v6
with:
context: "{{defaultContext}}:${{ matrix.IMAGE_TAG }}"
push: true
tags: ghcr.io/${{ env.GHCR_NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ matrix.IMAGE_TAG }}
env:
GHCR_NAMESPACE: dfhack
IMAGE_NAME: build-env