Skip to content

Build and Push

Build and Push #45

name: Build and Push
on:
workflow_run:
workflows: ["Run Tests"]
branches: [master]
types:
- completed
jobs:
bump-version:
name: "Bump Version on master"
runs-on: ubuntu-latest
steps:
- name: "Checkout source code"
uses: "actions/checkout@v3"
with:
ref: ${{ github.ref }}
fetch-depth: 50
- name: "cat package.json"
run: cat ./package.json
- name: "Setup Node.js"
uses: "actions/setup-node@v3"
with:
node-version: 16
- name: "Automated Version Bump"
id: version-bump
uses: "phips28/gh-action-bump-version@master"
with:
tag-prefix: ''
minor-wording: 'minor_bump'
major-wording: 'major_bump'
patch-wording: 'patch_bump'
rc-wording: 'alpha_bump'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "cat package.json"
run: cat ./package.json
- name: 'Output Step'
env:
NEW_TAG: ${{ steps.version-bump.outputs.newTag }}
run: echo "new tag $NEW_TAG"
- name: "publish release notes"
uses: fregante/release-with-changelog@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
build:
name: "Build angles container and push to docker hub"
needs: bump-version
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 16.x ]
steps:
- uses: actions/checkout@v3
- run: git pull origin master
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Grab AnglesUI version
id: extract_version
uses: Saionaro/[email protected]
# From now you can access the version
- name: Print version
run: echo ${{ steps.extract_version.outputs.version }}
- name: Login to Docker Hub
run: docker login --username "${{ secrets.DOCKER_USERNAME }}" --password "${{ secrets.DOCKER_PASSWORD }}"
- name: Build the Docker Image
run: docker build . --file Dockerfile -t angleshq/angles:${{ steps.extract_version.outputs.version }} -t angleshq/angles:latest
- name: Push the Docker Image with version
run: docker push angleshq/angles:${{ steps.extract_version.outputs.version }}
- name: Push the Docker Image with latest
run: docker push angleshq/angles:latest