From d87d276960fd7693a6c0d13631bf6e92196a62b9 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Tue, 18 Apr 2023 09:31:39 +0800 Subject: [PATCH] ci: add Docker login and pull job to CI pipeline (#244) - Add a new job named "testing04" for docker login and pull in ci.yml file. ref: https://github.com/appleboy/ssh-action/issues/230 --- .github/workflows/ci.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9da0438..d1b576f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -216,3 +216,32 @@ jobs: script: | git clone https://appleboy:${{ secrets.TEST_TOKEN }}@github.com/go-training/self-runner.git test_repository rm -rf test_repository + + testing04: + name: docker login and pull + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v1 + + - name: login GitHub Container Registry + uses: ./ + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.KEY }} + port: ${{ secrets.PORT }} + script_stop: true + script: | + echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u github.actor --password-stdin + + - name: login DockerHub Container Registry + uses: ./ + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.KEY }} + port: ${{ secrets.PORT }} + script_stop: true + script: | + echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin