Merge pull request #16 from keepsimpleio/chore/header-active-page #16
This file contains hidden or 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: CI Deployment | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| - 'dev' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v1 | |
| - name: 'Login to GitHub Container Registry' | |
| run: echo ${{secrets.REGISTRY_PASSWORD}} | docker login ${{secrets.REGISTRY_HOST}} --username ${{secrets.REGISTRY_USERNAME}} --password-stdin | |
| - name: Decode production env file | |
| if: github.ref == 'refs/heads/main' | |
| run: | | |
| echo ${{ secrets.ENV_PRODUCTION }} | base64 -d > .env | |
| - name: Decode staging env file | |
| if: github.ref == 'refs/heads/dev' | |
| run: | | |
| echo ${{ secrets.ENV_STAGING }} | base64 -d > .env | |
| - name: Production Deploy | |
| if: github.ref == 'refs/heads/main' | |
| run: | | |
| docker build -t ${{ secrets.REGISTRY_HOST }}/uxc-frontend:prod . | |
| docker push ${{ secrets.REGISTRY_HOST }}/uxc-frontend:prod | |
| - name: Staging Deploy | |
| if: github.ref == 'refs/heads/dev' | |
| run: | | |
| docker build -t ${{ secrets.REGISTRY_HOST }}/uxc-frontend:staging . | |
| docker push ${{ secrets.REGISTRY_HOST }}/uxc-frontend:staging | |