Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
adding a github workflow for vc-to-dwn-server (#55)
Browse files Browse the repository at this point in the history
* adding a github workflow for vc-to-dwn-server

* Update .github/workflows/vc-to-dwn-server-container-image.yml

Co-authored-by: Finn <[email protected]>

---------

Co-authored-by: Rizel Scarlett <[email protected]>
Co-authored-by: Finn <[email protected]>
  • Loading branch information
3 people authored Aug 23, 2024
1 parent 18bd246 commit 0aed53a
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 55 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/vc-to-dwn-server-container-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: VC to DWN Server Container Image Build

on:
push:
branches:
- main
paths:
- 'javascript/vc-to-dwn-server/*'
- .github/workflows/vc-to-dwn-server-container-image.yaml
pull_request:
branches:
- main
paths:
- 'javascript/vc-to-dwn-server/*'
- .github/workflows/vc-to-dwn-server-container-image.yaml

jobs:
build-image:
name: Build Container Image / javascript/vc-to-dwn-server
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to the container registry
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
with:
images: ghcr.io/tbd54566975/tbd-examples-vc-to-dwn-server
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=sha
- name: Build and push container image
uses: docker/build-push-action@94f8f8c2eec4bc3f1d78c1755580779804cb87b2 # v6.0.1
with:
context: javascript/vc-to-dwn-server
push: true
target: ${{ matrix.target }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Deploy new image
if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' }}
run: |
set -ex
mkdir ~/.ssh
echo "${{ secrets.VC_TO_DWN_SERVER_RELEASE_KEY }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
git clone [email protected]:tbdeng/vc-to-dwn-server-helm
cd tbd-vc-to-dwn-server
git config user.email [email protected]
git config user.name "tbd deployer"
newtag="$(echo "${{ steps.meta.outputs.tags }}" | tail -n1)"
sed -i "s#image: ghcr.io/tbd54566975/tbd-examples-vc-to-dwn-server:.*#image: ${newtag}#" values.yaml
git commit values.yaml -m "Update image to ${newtag}"
git push
5 changes: 5 additions & 0 deletions javascript/vc-to-dwn-server/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
npm-debug.log
docker-compose.yml
.DS_Store
.git

This file was deleted.

0 comments on commit 0aed53a

Please sign in to comment.