Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add building web app image - skip e2e #2857

Merged
merged 1 commit into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,44 @@ jobs:
trigger_workflow: true
wait_workflow: true

publish-web-docker:
name: Build and publish Docker Image for Web App
needs: [e2e-base, e2e-vaults]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
token: ${{ secrets.CI_PAT_TOKEN }}
fetch-depth: 0

- name: Set up Node
uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
cache: 'yarn'

- name: Install dependencies
run: yarn install --immutable

- name: Build
run: yarn build:web

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Publish SNJS Docker image for E2E testing
run: |
cd packages/web
docker build -t standardnotes/web:${{ github.sha }} .
docker tag standardnotes/web:${{ github.sha }} standardnotes/web:latest
docker push standardnotes/web:${{ github.sha }}
docker push standardnotes/web:latest

publish:
name: Publish to NPM
needs: [e2e-base, e2e-vaults]
Expand Down
4 changes: 4 additions & 0 deletions packages/web/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM nginx:alpine

COPY ./dist /usr/share/nginx/html

Loading