-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (39 loc) · 1.29 KB
/
build-docker.yml
File metadata and controls
40 lines (39 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
on:
push:
branches: [main]
schedule:
- cron: "0 3 * * 1"
workflow_dispatch:
jobs:
build:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
strategy:
matrix:
factorio_version: ["stable", "experimental"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get latest version of ${{ matrix.factorio_version }}
id: get_latest_version
run: |
echo ::set-output name=version::$(curl -sSL https://factorio.com/api/latest-releases | jq -r .${{ matrix.factorio_version }}.headless)
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up docker buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
push: true
tags: |
ghcr.io/coderadu/factorio-docker:${{ matrix.factorio_version }}
ghcr.io/coderadu/factorio-docker:${{ steps.get_latest_version.outputs.version }}
build-args: |
VERSION=${{ steps.get_latest_version.outputs.version }}