chore(deps): update ghcr.io/coder/code-server docker tag to v4.96.4 #217
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: π Deploy | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
pull_request: {} | |
permissions: | |
actions: write | |
contents: read | |
jobs: | |
lint: | |
name: ⬣ ESLint | |
runs-on: ubuntu-latest | |
steps: | |
# - name: π Cancel Previous Runs | |
# uses: styfle/cancel-workflow-action@0.11.0 | |
- name: β¬οΈ Checkout repo | |
uses: actions/checkout@v3 | |
- name: Setup PNPM | |
uses: pnpm/action-setup@v2.2.4 | |
with: | |
version: 7 | |
- name: β Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: "pnpm" | |
- name: π₯ Download deps | |
run: pnpm install --frozen-lockfile | |
- name: π¬ Lint | |
run: pnpm run lint | |
typecheck: | |
name: Κ¦ TypeScript | |
runs-on: ubuntu-latest | |
steps: | |
# - name: π Cancel Previous Runs | |
# uses: styfle/cancel-workflow-action@0.11.0 | |
- name: β¬οΈ Checkout repo | |
uses: actions/checkout@v3 | |
- name: Setup PNPM | |
uses: pnpm/action-setup@v2.2.4 | |
with: | |
version: 7 | |
- name: β Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: "pnpm" | |
- name: π₯ Download deps | |
run: pnpm install --frozen-lockfile | |
- name: π Type check | |
run: pnpm run typecheck | |
# vitest: | |
# name: β‘ Vitest | |
# runs-on: ubuntu-latest | |
# steps: | |
# # - name: π Cancel Previous Runs | |
# # uses: styfle/cancel-workflow-action@0.11.0 | |
# - name: β¬οΈ Checkout repo | |
# uses: actions/checkout@v3 | |
# - name: Setup PNPM | |
# uses: pnpm/action-setup@v2.2.4 | |
# with: | |
# version: 7 | |
# - name: β Setup node | |
# uses: actions/setup-node@v3 | |
# with: | |
# node-version: 18 | |
# cache: "pnpm" | |
# - name: π₯ Download deps | |
# run: pnpm install --frozen-lockfile | |
# - name: β‘ Run vitest | |
# run: pnpm run vitest -- --coverage | |
# e2e: | |
# name: β«οΈ e2e | |
# runs-on: ubuntu-latest | |
# steps: | |
# # - name: π Cancel Previous Runs | |
# # uses: styfle/cancel-workflow-action@0.11.0 | |
# - name: β¬οΈ Checkout repo | |
# uses: actions/checkout@v3 | |
# - name: π Copy test env vars | |
# run: cp .env.example .env | |
# - name: Setup PNPM | |
# uses: pnpm/action-setup@v2.2.4 | |
# with: | |
# version: 7 | |
# - name: β Setup node | |
# uses: actions/setup-node@v3 | |
# with: | |
# node-version: 18 | |
# cache: "pnpm" | |
# - name: π₯ Download deps | |
# run: | | |
# # pnpx cypress install | |
# pnpm install --frozen-lockfile | |
# - name: π₯ Cache cypress binary | |
# uses: actions/cache@v3 | |
# with: | |
# path: ~/.cache/Cypress | |
# key: ${{ runner.os }}-cypress-${{ matrix.browsers }} | |
# - name: π Setup Database | |
# run: pnpx prisma migrate reset --force | |
# - name: βοΈ Build | |
# run: pnpm run build | |
# - name: Install Playwright Browsers | |
# run: npx playwright install --with-deps | |
# - name: Run Playwright tests | |
# run: pnpm dlx playwright test | |
# - uses: actions/upload-artifact@v3 | |
# if: always() | |
# with: | |
# name: playwright-report | |
# path: playwright-report/ | |
# retention-days: 30 | |
# - name: π³ Cypress run | |
# uses: cypress-io/github-action@v4 | |
# with: | |
# start: pnpm run start:mocks | |
# wait-on: "http://localhost:8811" | |
# browser: ${{ matrix.browsers }} | |
# record: true | |
# env: | |
# PORT: "8811" | |
# CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# - uses: actions/upload-artifact@v3 | |
# if: failure() | |
# with: | |
# name: cypress-screenshots-${{ matrix.browsers }} | |
# path: cypress/screenshots | |
# - uses: actions/upload-artifact@v3 | |
# if: always() | |
# with: | |
# name: cypress-videos | |
# path: cypress/videos | |
build: | |
name: π³ Build | |
# only build/deploy main branch on pushes | |
if: ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop') && github.event_name == 'push' }} | |
runs-on: ubuntu-latest | |
steps: | |
# - name: π Cancel Previous Runs | |
# uses: styfle/cancel-workflow-action@0.11.0 | |
- name: β¬οΈ Checkout repo | |
uses: actions/checkout@v3 | |
- name: π Read app name | |
uses: SebRollen/toml-action@v1.0.2 | |
id: app_name | |
with: | |
file: "fly.toml" | |
field: "app" | |
- name: π³ Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
# Setup cache | |
- name: β‘οΈ Cache Docker layers | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: π Fly Registry Auth | |
uses: docker/login-action@v2 | |
with: | |
registry: registry.fly.io | |
username: x | |
password: ${{ secrets.FLY_API_TOKEN }} | |
- name: π Docker Registry Auth | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: π³ Docker build | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
push: true | |
tags: | | |
registry.fly.io/${{ steps.app_name.outputs.value }}:${{ github.ref_name }}-${{ github.sha }} | |
stiforr/${{ steps.app_name.outputs.value }}:${{ github.ref_name }}-${{ github.sha }} | |
build-args: | | |
COMMIT_SHA=${{ github.sha }} | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new | |
# This ugly bit is necessary if you don't want your cache to grow forever | |
# till it hits GitHub's limit of 5GB. | |
# Temp fix | |
# https://github.com/docker/build-push-action/issues/252 | |
# https://github.com/moby/buildkit/issues/1896 | |
- name: π Move cache | |
run: | | |
rm -rf /tmp/.buildx-cache | |
mv /tmp/.buildx-cache-new /tmp/.buildx-cache | |
sentry-release: | |
name: π¦ Sentry Release | |
runs-on: ubuntu-latest | |
needs: [lint, typecheck, build] | |
# only build/deploy main branch on pushes | |
if: ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop') && github.event_name == 'push' }} | |
steps: | |
- name: β¬οΈ Checkout repo | |
uses: actions/checkout@v3 | |
- name: Setup PNPM | |
uses: pnpm/action-setup@v2.2.4 | |
with: | |
version: 7 | |
- name: β Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: "pnpm" | |
- name: π₯ Download deps | |
run: pnpm install --frozen-lockfile | |
- name: Build | |
run: pnpm build | |
- name: π¦ Create Sentry Release | |
uses: getsentry/action-release@v1 | |
with: | |
environment: ${{ github.ref_name }} | |
version: ${{ github.sha }} | |
sourcemaps: "./build ./public/build" | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
SENTRY_ORG: ${{ secrets.SENTRY_ORG }} | |
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} | |
- name: Remove sourcemaps | |
run: | | |
find ./public/build -type f -name '*.map' -delete | |
find ./build -type f -name '*.map' -delete | |
deploy: | |
name: π Deploy | |
runs-on: ubuntu-latest | |
needs: [lint, typecheck, build] | |
# only build/deploy main branch on pushes | |
if: ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop') && github.event_name == 'push' }} | |
steps: | |
# - name: π Cancel Previous Runs | |
# uses: styfle/cancel-workflow-action@0.11.0 | |
- name: β¬οΈ Checkout repo | |
uses: actions/checkout@v3 | |
- name: π Read app name | |
uses: SebRollen/toml-action@v1.0.2 | |
id: app_name | |
with: | |
file: "fly.toml" | |
field: "app" | |
- name: π Deploy Staging | |
if: ${{ github.ref == 'refs/heads/develop' }} | |
uses: superfly/flyctl-actions@v1.4 | |
with: | |
args: "deploy --app ${{ steps.app_name.outputs.value }} --remote-only" | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | |
- name: π Deploy Production | |
if: ${{ github.ref == 'refs/heads/main' }} | |
uses: superfly/flyctl-actions@v1.4 | |
with: | |
args: "deploy --app ${{ steps.app_name.outputs.value }} --remote-only" | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} |