Skip to content

Commit

Permalink
Add a workflow for csharp-dotnet8
Browse files Browse the repository at this point in the history
  • Loading branch information
Redande committed Jan 31, 2024
1 parent 90917a8 commit 39e4c85
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/upload-csharp-dotnet8-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Deploy csharp-dotnet8

on:
push:
tags:
- "all-[0-9]+.[0-9]+"
- "csharp-dotnet8-[0-9]+.[0-9]+"

env:
TAG: ${{ github.ref_name }}

jobs:
build_and_upload:
name: Build and deploy
runs-on: ubuntu-latest
steps:
- name: Extract version from tag
run: |
echo "VERSION=${TAG#all-}" >> $GITHUB_ENV
echo "VERSION=${TAG#csharp-dotnet8-}" >> $GITHUB_ENV
- name: Enable Docker IPv6
run: |
echo '{ "ipv6": true }' | sudo tee -a /etc/docker/daemon.json
sudo systemctl reload docker
- uses: actions/checkout@v1
- name: Authenticate to Google Cloud
env:
GCLOUD_SERVICE_KEY: ${{ secrets.GCLOUD_SERVICE_KEY }}
run: |
echo Authenticating to Google Cloud
echo $GCLOUD_SERVICE_KEY | python -m base64 -d > /tmp/key.json
gcloud auth activate-service-account --key-file=/tmp/key.json
if gcloud auth configure-docker -q; then
echo "Authenticated to Google Cloud..."
else
echo "Authentication to Google Cloud failed. Exiting..."
exit 1
fi
- name: Building image
run: |
source ./env
cd csharp-dotnet8
docker build . -t "eu.gcr.io/moocfi-public/tmc-sandbox-csharp-dotnet8:$VERSION" --build-arg "RUST_CLI_URL=$RUST_CLI_URL"
cd ..
- name: Pushing image
run: |
source ./env
cd csharp-dotnet8
docker push "eu.gcr.io/moocfi-public/tmc-sandbox-csharp-dotnet8:$VERSION"
docker tag "eu.gcr.io/moocfi-public/tmc-sandbox-csharp-dotnet8:$VERSION" "eu.gcr.io/moocfi-public/tmc-sandbox-csharp-dotnet8:latest"
docker push "eu.gcr.io/moocfi-public/tmc-sandbox-csharp-dotnet8:latest"
cd ..

0 comments on commit 39e4c85

Please sign in to comment.