Merge pull request #1885 from vector-im/renovate/node-20.x-lockfile #454
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 & publish images to the package registry for tags | |
on: | |
release: | |
types: [published] | |
push: | |
branches: [livekit] | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build: | |
name: Build & publish | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # required to upload release asset | |
packages: write | |
steps: | |
- name: Get current time | |
id: current-time | |
run: echo "unix_time=$(date +'%s')" >> $GITHUB_OUTPUT | |
- name: Check it out | |
uses: actions/checkout@v4 | |
- name: Log in to container registry | |
uses: docker/login-action@1f401f745bf57e30b3a2800ad308a87d2ebdf14b | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Yarn cache | |
uses: actions/setup-node@v4 | |
with: | |
cache: "yarn" | |
- name: Install dependencies | |
run: "yarn install" | |
- name: Build | |
run: "yarn run build" | |
env: | |
SENTRY_ORG: ${{ secrets.SENTRY_ORG }} | |
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} | |
SENTRY_URL: ${{ secrets.SENTRY_URL }} | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
VITE_APP_VERSION: ${{ github.event.release.tag_name || github.sha }} | |
- name: Create Tarball | |
env: | |
TARBALL_VERSION: ${{ github.event.release.tag_name || github.sha }} | |
run: | | |
tar --numeric-owner --transform "s/dist/element-call-${TARBALL_VERSION}/" -cvzf element-call-${TARBALL_VERSION}.tar.gz dist | |
- name: Upload | |
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
path: "./element-call-*.tar.gz" | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@62339db73c56dd749060f65a6ebb93a6e056b755 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
tags: | | |
type=sha,format=short,event=branch | |
type=semver,pattern=v{{version}} | |
type=raw,value=latest-ci,enable={{is_default_branch}} | |
type=raw,value=latest-ci_${{steps.current-time.outputs.unix_time}},enable={{is_default_branch}} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@6d5347c4025fdf2bb05167a2519cac535a14a408 | |
- name: Build and push Docker image | |
uses: docker/build-push-action@fdf7f43ecf7c1a5c7afe936410233728a8c2d9c2 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |