internal: update vcpkg & use upstream mongo-cxx-driver port (#2179) #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & Push Vcpkg Deps (Docker) | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
- 'vcpkg' | |
- 'Dockerfile' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' # ensures submodules are checked out | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Extract short SHA | |
shell: bash | |
run: echo "SHORT_SHA=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_ENV | |
- name: Extract submodule details | |
shell: bash | |
run: | | |
cd vcpkg | |
echo "VCPKG_URL=$(git config --get remote.origin.url)" >> $GITHUB_ENV | |
echo "VCPKG_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV | |
cd .. | |
- name: Cache Docker layers | |
uses: actions/cache@v2 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-vcpkg-${{ github.run_number }} | |
restore-keys: | | |
${{ runner.os }}-buildx-vcpkg- | |
- name: Build and push skymp-vcpkg-deps | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
file: ./Dockerfile | |
target: skymp-vcpkg-deps | |
builder: ${{ steps.buildx.outputs.name }} | |
push: true | |
tags: skymp/skymp-vcpkg-deps:${{ env.SHORT_SHA }} | |
build-args: | | |
VCPKG_URL=${{ env.VCPKG_URL }} | |
VCPKG_COMMIT=${{ env.VCPKG_COMMIT }} | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache | |
- name: Cache Docker layers | |
uses: actions/cache@v2 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-runtime-${{ github.run_number }} | |
restore-keys: | | |
${{ runner.os }}-buildx-runtime- | |
- name: Build and push skymp-runtime-base | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
file: ./Dockerfile | |
target: skymp-runtime-base | |
builder: ${{ steps.buildx.outputs.name }} | |
push: true | |
tags: skymp/skymp-runtime-base:${{ env.SHORT_SHA }} | |
build-args: | | |
VCPKG_URL=${{ env.VCPKG_URL }} | |
VCPKG_COMMIT=${{ env.VCPKG_COMMIT }} | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache | |
- name: Replace image tags in files | |
run: | | |
sed -i "s|skymp/skymp-runtime-base:[^ ]*|skymp/skymp-runtime-base:${{ env.SHORT_SHA }}|g" misc/deploy/remote/branchctl.sh | |
sed -i "s|skymp/skymp-vcpkg-deps:[^ ]*|skymp/skymp-vcpkg-deps:${{ env.SHORT_SHA }}|g" misc/github_env_linux | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
commit-message: "internal: update skymp-runtime-base and skymp-vcpkg-deps to ${{ env.SHORT_SHA }}" | |
title: "internal: update skymp-runtime-base and skymp-vcpkg-deps to ${{ env.SHORT_SHA }}" | |
body: Bot put here this release PR, enjoy... | |
branch: "internal-update-images-${{ env.SHORT_SHA }}" |