clean unused packages #11
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 and deploy | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
name: "Build image" | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Get package version | |
id: version | |
uses: martinbeentjes/npm-get-version-action@main | |
- name: Log in to the Container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: | | |
"ghcr.io/${{ github.repository }}:latest" | |
"ghcr.io/${{ github.repository }}:${{ steps.version.outputs.current-version}}-${{ github.run_id }}" | |
labels: "version=${{ steps.version.outputs.current-version}}-${{ github.run_id }}" | |
deploy-stage: | |
name: "Staging deploy" | |
runs-on: ubuntu-latest | |
needs: build | |
environment: staging | |
steps: | |
- name: Deploy Stage | |
uses: fjogeleit/http-request-action@v1 | |
with: | |
url: ${{ secrets.DEPLOY_WEBHOOK_URL }} | |
method: 'POST' | |
timeout: 30000 |