refactor(workflows): 🎉 update action workflows #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Image CI | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: test | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Extract Version from package.json | |
id: project_version | |
run: echo "::set-output name=version::$(node -e 'console.log(require("./package.json").version)')" | |
- name: Set environment secret to env variable | |
run: | | |
export MY_SECRET_VARIABLE=env_test | |
- name: test echo | |
run: echo $MY_SECRET_VARIABLE | |
- name: Build the Docker Image | |
run: | | |
docker build \ | |
--file Dockerfile-dev \ | |
--tag robolaunchio/frontend-public:${{ steps.project_version.outputs.version }}-dev \ | |
. | |
- name: Login to Docker Hub | |
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | |
- name: Push the Docker Image to Docker Hub | |
run: docker push robolaunchio/frontend-public:${{ steps.project_version.outputs.version }}-dev |