Skip to content

Commit 0d4dca3

Browse files
committed
CI/CD enable clone submodules, Update CI/CD runner versions
Our levels are delivered as a git submodule, therefore we need to init all submodules
1 parent 1ac3810 commit 0d4dca3

File tree

1 file changed

+32
-14
lines changed

1 file changed

+32
-14
lines changed

.github/workflows/deploy-image.yml

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
#
22
name: Create and publish a Docker image
33

4-
# Configures this workflow to run every time a change is pushed to the branch called `main`.
4+
# Configures this workflow to run every time a change is pushed to the branch called
5+
# `main` or `dev`.
56
on:
67
push:
78
branches: ['main', 'dev']
89
tags: ['*']
910

10-
# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
11+
# Defines two custom environment variables for the workflow. These are used for the
12+
# Container registry domain, and a name for the Docker image that this workflow builds.
1113
env:
1214
REGISTRY: ghcr.io
1315
IMAGE_NAME: ${{ github.repository }}
1416

15-
# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
17+
# There is a single job in this workflow. It's configured to run on the latest available
18+
# version of Ubuntu.
1619
jobs:
1720
build-and-push-image:
1821
runs-on: ubuntu-latest
@@ -25,21 +28,28 @@ jobs:
2528

2629
steps:
2730
- name: Checkout repository
28-
uses: actions/checkout@v4
31+
uses: actions/checkout@v6
32+
with:
33+
submodules: true
2934

30-
# Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
35+
# Uses the `docker/login-action` action to log in to the Container registry registry
36+
# using the account and password that will publish the packages. Once published, the
37+
# packages are scoped to the account defined here.
3138
- name: Log in to the Container registry
32-
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
39+
uses: docker/login-action@v3
3340
with:
3441
registry: ${{ env.REGISTRY }}
3542
username: ${{ github.actor }}
3643
password: ${{ secrets.GITHUB_TOKEN }}
3744

38-
# This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels.
45+
# This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about)
46+
# to extract tags and labels that will be applied to the specified image.
47+
# The `id` "meta" allows the output of this step to be referenced in a subsequent
48+
# step. The `images` value provides the base name for the tags and labels.
3949
# It will automatically create the latest Docker tag, if a git tag is found: https://github.com/docker/metadata-action?tab=readme-ov-file#latest-tag
4050
- name: Extract metadata (tags, labels) for Docker
4151
id: meta
42-
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
52+
uses: docker/metadata-action@v5
4353
with:
4454
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
4555

@@ -51,12 +61,17 @@ jobs:
5161
calculatedSha=$(git rev-parse --short ${{ github.sha }})
5262
echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV
5363
54-
# This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages.
55-
# It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see [Usage](https://github.com/docker/build-push-action#usage) in the README of the `docker/build-push-action` repository.
56-
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
64+
# This step uses the `docker/build-push-action` action to build the image, based on
65+
# your repository's `Dockerfile`. If the build succeeds, it pushes the image to
66+
# GitHub Packages.
67+
# It uses the `context` parameter to define the build's context as the set of files
68+
# located in the specified path. For more information, see [Usage](https://github.com/docker/build-push-action#usage)
69+
# in the README of the `docker/build-push-action` repository.
70+
# It uses the `tags` and `labels` parameters to tag and label the image with the
71+
# output from the "meta" step.
5772
- name: Build and push Docker image
5873
id: push
59-
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
74+
uses: docker/build-push-action@v6
6075
with:
6176
context: .
6277
push: true
@@ -66,9 +81,12 @@ jobs:
6681
GAME_GIT_HASH=${{ github.sha }}
6782
GAME_GIT_HASH_SHORT=${{ env.COMMIT_SHORT_SHA }}
6883
69-
# This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see [Using artifact attestations to establish provenance for builds](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds).
84+
# This step generates an artifact attestation for the image, which is an unforgeable
85+
# statement about where and how it was built. It increases supply chain security for
86+
# people who consume the image. For more information, see [Using artifact attestations
87+
# to establish provenance for builds](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds).
7088
- name: Generate artifact attestation
71-
uses: actions/attest-build-provenance@v2
89+
uses: actions/attest-build-provenance@v3
7290
with:
7391
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
7492
subject-digest: ${{ steps.push.outputs.digest }}

0 commit comments

Comments
 (0)