asdf #79
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: Deploy kdetosakra CI | |
on: | |
push: | |
branches: [ "master" ] | |
paths: | |
- "src/**" | |
- "public/**" | |
- "server/**" | |
- "*.{js,json,sh}" | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | |
with: | |
username: ${{ secrets.DOCKER_USER }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Declare some variables | |
id: vars | |
shell: bash | |
run: | | |
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" | |
- name: Build the Docker image | |
env: | |
API_KEY: ${{secrets.API_KEY}} | |
FIREBASE_MEASUREMENT_ID: ${{secrets.FIREBASE_MEASUREMENT_ID}} | |
FIREBASE_APP_ID: ${{secrets.FIREBASE_APP_ID}} | |
FIREBASE_MESSAGING_SENDER_ID: ${{secrets.FIREBASE_MESSAGING_SENDER_ID}} | |
FIREBASE_STORAGE_BUCKET: ${{secrets.FIREBASE_STORAGE_BUCKET}} | |
FIREBASE_PROJECT_ID: ${{secrets.FIREBASE_PROJECT_ID}} | |
FIREBASE_AUTH_DOMAIN: ${{secrets.FIREBASE_AUTH_DOMAIN}} | |
FIREBASE_API_KEY: ${{secrets.FIREBASE_API_KEY}} | |
SENTRY_DNS: ${{secrets.SENTRY_DNS}} | |
WEB_URL: ${{secrets.WEB_URL}} | |
run: | | |
docker build \ | |
--file Dockerfile \ | |
--build-arg API_KEY=$API_KEY \ | |
--build-arg FIREBASE_MEASUREMENT_ID=$FIREBASE_MEASUREMENT_ID \ | |
--build-arg FIREBASE_APP_ID=$FIREBASE_APP_ID \ | |
--build-arg FIREBASE_MESSAGING_SENDER_ID=$FIREBASE_MESSAGING_SENDER_ID \ | |
--build-arg FIREBASE_STORAGE_BUCKET=$FIREBASE_STORAGE_BUCKET \ | |
--build-arg FIREBASE_PROJECT_ID=$FIREBASE_PROJECT_ID \ | |
--build-arg FIREBASE_AUTH_DOMAIN=$FIREBASE_AUTH_DOMAIN \ | |
--build-arg FIREBASE_API_KEY=$FIREBASE_API_KEY \ | |
--build-arg SENTRY_DNS=$SENTRY_DNS \ | |
--build-arg WEB_URL=$WEB_URL \ | |
--tag bouchja1/kdetosakra:${{ steps.vars.outputs.sha_short }} \ | |
--tag bouchja1/kdetosakra:latest \ | |
. | |
- name: Docker push | |
run: | | |
docker push bouchja1/kdetosakra:${{ steps.vars.outputs.sha_short }} | |
docker push bouchja1/kdetosakra:latest |