Skip to content

Bump screeps from 4.2.15 to 4.2.18 #102

Bump screeps from 4.2.15 to 4.2.18

Bump screeps from 4.2.15 to 4.2.18 #102

name: Build and push to Docker Hub
on:
workflow_dispatch:
push:
paths:
- "Dockerfile"
- "screeps-cli.js"
- "screeps-start.js"
- "package-lock.json"
tags:
- "v*.*.*"
branches:
- "main"
pull_request:
branches:
- "main"
jobs:
release:
runs-on: ubuntu-latest
strategy:
matrix:
node: [10, 12]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
if: ${{ github.event_name != 'pull_request' }}
with:
github-token: ${{ github.token }}
flavor: |
latest=auto
suffix=${{ matrix.node != 10 && format('-node{0}', matrix.node) || '' }},onlatest=true
images: |
${{ secrets.DOCKER_HUB_USERNAME }}/screeps-server
tags: |
type=edge,branch=main
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
type=sha
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
if: ${{ github.event_name != 'pull_request' }}
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
build-args: |
NODE_VERSION=${{ matrix.node }}
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}