From 47add702973964367d8f78bb5aca721975feadfa Mon Sep 17 00:00:00 2001 From: Loran Mutafov Date: Sun, 26 Feb 2023 19:40:49 +0100 Subject: [PATCH] Add pipeline for beta releases --- .github/workflows/build-beta.yml | 29 +++++++++++++++++++ .../{build-tag.yml => build-stable.yml} | 4 +-- 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build-beta.yml rename .github/workflows/{build-tag.yml => build-stable.yml} (93%) diff --git a/.github/workflows/build-beta.yml b/.github/workflows/build-beta.yml new file mode 100644 index 0000000..9fe8f1b --- /dev/null +++ b/.github/workflows/build-beta.yml @@ -0,0 +1,29 @@ +name: Build a beta version + +on: + push: + tags: + - v[0-9]+.[0-9]+.[0-9]+-beta* + +env: + IMAGE_NAME: loranmutafov/simple-bastion + +jobs: + build: + name: Build and push :${{ github.ref_name }} to Docker Hub + runs-on: ubuntu-latest + steps: + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Build Docker image + run: DOCKER_BUILDKIT=1 docker build . -t $IMAGE_NAME:${{ github.ref_name }} + + - name: Push Docker image + run: docker push $IMAGE_NAME:${{ github.ref_name }} diff --git a/.github/workflows/build-tag.yml b/.github/workflows/build-stable.yml similarity index 93% rename from .github/workflows/build-tag.yml rename to .github/workflows/build-stable.yml index 071d26d..7634d51 100644 --- a/.github/workflows/build-tag.yml +++ b/.github/workflows/build-stable.yml @@ -1,9 +1,9 @@ -name: Build a version +name: Build a stable version on: push: tags: - - v* + - v[0-9]+.[0-9]+.[0-9]+ env: IMAGE_NAME: loranmutafov/simple-bastion