diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..55e0c56 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,17 @@ +name: Build Project + +on: + push: + branches: + - '*' + - '!gh-pages' + - '!master' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v1 + - name: Create a new build + run: docker build -t publisher:latest -f ./dockerfiles/Deploy.Dockerfile . diff --git a/.github/workflows/default.yml b/.github/workflows/deploy.yml similarity index 89% rename from .github/workflows/default.yml rename to .github/workflows/deploy.yml index 9c5b279..4b081ec 100644 --- a/.github/workflows/default.yml +++ b/.github/workflows/deploy.yml @@ -1,24 +1,20 @@ -name: CI/CD +name: Build & Deploy on: push: branches: - - '*' - - '!gh-pages' + - 'master' jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v1 - - name: Create a new build - run: docker build -t publisher:latest -f ./dockerfiles/Deploy.Dockerfile . deploy: runs-on: ubuntu-latest needs: build if: github.ref == 'refs/heads/master' steps: + - name: Checkout + uses: actions/checkout@v1 + - name: Create a new build + run: docker build -t publisher:latest -f ./dockerfiles/Deploy.Dockerfile . - name: Deploy to gh-pages branch env: REPOSITORY_TOKEN: ${{ secrets.REPOSITORY_TOKEN }}