Bump Node to 20.15 and switch to pnpm (#89) #77
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: Publish to DockerHub | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
branches: | |
- 'main' | |
release: | |
types: [created] | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: communityfirst/guardianconnector-explorer | |
- name: Run tests | |
run: | | |
npm install -g pnpm | |
pnpm install | |
pnpm run test | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./Dockerfile | |
platforms: linux/amd64 | |
push: true | |
tags: | | |
${{ steps.meta.outputs.tags }} | |
${{ github.ref == 'refs/heads/main' && 'communityfirst/guardianconnector-explorer:latest' || '' }} | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Docker Hub Description | |
if: github.event_name == 'release' | |
uses: peter-evans/dockerhub-description@v4 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
repository: communityfirst/guardianconnector-explorer | |
short-description: 'A Nuxt app to explore GuardianConnector data in different views' | |
# - name: Test run of Docker image | |
# run: | | |
# docker run --rm \ | |
# -e NUXT_DATABASE="your_db_location" | |
# -e NUXT_DB_HOST="localhost" | |
# -e NUXT_DB_USER="your_db_user" | |
# -e NUXT_DB_PASSWORD="your_db_password" | |
# -e NUXT_DB_PORT="5432" | |
# -e NUXT_DB_SSL="true" | |
# -e NUXT_SQLITE_DB_PATH="./sql.db" | |
# -e NUXT_PORT="8080" | |
# -e NUXT_ENV_AUTH_STRATEGY="none" | |
# -e NUXT_OAUTH_AUTH0_DOMAIN="domain.us.auth0.com" | |
# -e NUXT_OAUTH_AUTH0_CLIENT_ID="" | |
# -e NUXT_OAUTH_AUTH0_CLIENT_SECRET="" | |
# -e NUXT_PUBLIC_BASE_URL='http://localhost:3000' | |
# -e NUXT_PUBLIC_APP_API_KEY="" | |
# ${{ steps.meta.outputs.tags }} |