diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..63e9eef --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,46 @@ +--- +name: Reusable workflow for Docker Build + +on: + workflow_call: + inputs: + version: + description: 'Version tag of docker build' + required: false + type: string + + docker: + name: Docker Build Push + runs-on: ubuntu-latest + + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + uses: docker/metadata-action@v5 + id: meta + with: + images: ghcr.io/${{ github.repository }} + tags: | + type=raw,value=latest + type=raw,value=${{ inputs.version }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v6 + with: + file: Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + provenance: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..8a06be0 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,44 @@ +--- +name: Reusable workflow for Semantic Release + +on: + workflow_call: + inputs: + node_version: + description: 'Which node version for semantic release environment' + default: 20 + required: false + type: number + outputs: + version: + description: "Version for next release" + value: ${{ jobs.semantic.outputs.version }} + +jobs: + semantic: + name: Semantic Release + runs-on: ubuntu-latest + outputs: + version: ${{ steps.semantic-release.outputs.version }} + permissions: + contents: write + issues: write + pull-requests: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ inouts.node_version }} + + - name: Install dependencies + run: npm ci + + - name: Run semantic-release + id: semantic-release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: npx semantic-release