From f393c68f3367bb4b4cae4f2be3d1ffd1e4f1c545 Mon Sep 17 00:00:00 2001 From: TShapinsky Date: Mon, 20 Mar 2023 09:10:41 -0600 Subject: [PATCH] Add package building --- .github/workflows/build.yml | 48 +++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..cc98686 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,48 @@ +name: Build for Development + +on: + push: + branches: + - '*' + release: + types: [released] + + +env: + REGISTRY: ghcr.io + +jobs: + build-image: + name: Build image + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Log into container registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Docker meta + uses: docker/metadata-action@v4 + id: meta + with: + images: | + ${{ env.REGISTRY }}/${{ github.repository }} + tags: | + type=ref,event=branch + type=sha + type=semver,pattern={{version}},enable=${{ github.event_name == 'release' }} + type=semver,pattern={{major}},enable=${{ github.event_name == 'release' }} + + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.output.labels }} \ No newline at end of file