diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 4ca6e91..b6dc0d1 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,41 +1,51 @@ name: Docker Image CI on: - push: - branches: ["master"] - pull_request: - branches: ["master"] + push: + branches: ['master'] + pull_request: + branches: ['master'] jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Decode secrets - env: - DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}} - DOCKER_URL_IMAGE_TO_PUSH: ${{secrets.DOCKER_URL_IMAGE_TO_PUSH}} - DOCKER_USER: ${{secrets.DOCKER_USER}} - ENVS_JSON: ${{secrets.ENVS_JSON}} - SQLITE_DUMP: ${{secrets.SQLITE_DUMP}} - run: | - echo "$ENVS_JSON" | base64 -d > envs.json - echo "$SQLITE_DUMP" | base64 -d > database.sqlite - - - name: Docker login and build - env: - DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}} - DOCKER_URL_IMAGE_TO_PUSH: ${{secrets.DOCKER_URL_IMAGE_TO_PUSH}} - DOCKER_USER: ${{secrets.DOCKER_USER}} - run: | - docker login -u $DOCKER_USER -p $DOCKER_PASSWORD - docker build . --file Dockerfile --tag $DOCKER_URL_IMAGE_TO_PUSH - - - name: Docker push - env: - DOCKER_URL_IMAGE_TO_PUSH: ${{secrets.DOCKER_URL_IMAGE_TO_PUSH}} - run: | - docker push $DOCKER_URL_IMAGE_TO_PUSH + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # - name: Decode secrets + # env: + # DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}} + # DOCKER_URL_IMAGE_TO_PUSH: ${{secrets.DOCKER_URL_IMAGE_TO_PUSH}} + # DOCKER_USER: ${{secrets.DOCKER_USER}} + # ENVS_JSON: ${{secrets.ENVS_JSON}} + # SQLITE_DUMP: ${{secrets.SQLITE_DUMP}} + # run: | + # echo "$ENVS_JSON" | base64 -d > envs.json + # echo "$SQLITE_DUMP" | base64 -d > database.sqlite + + # - name: Docker login and build + # env: + # DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}} + # DOCKER_URL_IMAGE_TO_PUSH: ${{secrets.DOCKER_URL_IMAGE_TO_PUSH}} + # DOCKER_USER: ${{secrets.DOCKER_USER}} + # run: | + # docker login -u $DOCKER_USER -p $DOCKER_PASSWORD + # docker build . --file Dockerfile --tag $DOCKER_URL_IMAGE_TO_PUSH + + # - name: Docker push + # env: + # DOCKER_URL_IMAGE_TO_PUSH: ${{secrets.DOCKER_URL_IMAGE_TO_PUSH}} + # run: | + # docker push $DOCKER_URL_IMAGE_TO_PUSH + + - name: SSH login + env: + SSH_IP: ${{secrets.SSH_IP}} + SSH_PUB_KEY: ${{secrets.SSH_PUB_KEY}} + SSH_USER: ${{secrets.SSH_USER}} + + run: echo "${{ secrets.SSH_PUB_KEY }}" > ~/.ssh/id_rsa.pub + ssh $SSH_USER@SSH_IP + touch uga.txt