name: Build and Push Docker Image on: workflow_dispatch: jobs: build: runs-on: ubuntu-latest permissions: contents: write packages: write steps: - uses: actions/checkout@v4 - name: Get version from package.json id: version run: echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT - name: Create tag run: | git config user.name github-actions git config user.email github-actions@github.com git tag -a v${{ steps.version.outputs.VERSION }} -m "Release v${{ steps.version.outputs.VERSION }}" git push origin v${{ steps.version.outputs.VERSION }} - name: Create GitHub Release uses: softprops/action-gh-release@v1 with: tag_name: v${{ steps.version.outputs.VERSION }} generate_release_notes: true - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v5 with: context: . push: true platforms: linux/amd64,linux/arm64 tags: | ghcr.io/lone-cloud/snowflake-dashboard:latest ghcr.io/lone-cloud/snowflake-dashboard:v${{ steps.version.outputs.VERSION }}