fix tutorial document #51
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: build and deploy container | |
on: | |
pull_request_target: | |
types: | |
- closed | |
jobs: | |
build_and_deploy: | |
if: github.event.pull_request.merged == true | |
env: | |
DOCKER_USER_NAME: ${{ vars.DOCKER_USER_NAME }} | |
DOCKER_CONTAINER_NAME: ${{ vars.DOCKER_CONTAINER_NAME }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: docker build -t ${DOCKER_USER_NAME}/${DOCKER_CONTAINER_NAME} . | |
- run: docker login -u ${DOCKER_USER_NAME} -p ${DOCKER_PASSWORD} | |
- run: docker push ${DOCKER_USER_NAME}/${DOCKER_CONTAINER_NAME} | |
backup: | |
needs: ["build_and_deploy"] | |
env: | |
BRANCH_NAME: ${{ github.ref_name }} | |
GITLAB_ACCESS_TOKEN: ${{ secrets.GITLAB_ACCESS_TOKEN }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- run: echo push to ${BRANCH_NAME} | |
- name: push to gitlab for backup | |
run: | | |
git push -f https://oauth2:${GITLAB_ACCESS_TOKEN}@gitlab.com/aicshud/WHEEL.git HEAD:${BRANCH_NAME} |