Skip to content

Merge branch 'dev-weibo' #9

Merge branch 'dev-weibo'

Merge branch 'dev-weibo' #9

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build the Docker image
run: |
docker build . --file Dockerfile --tag shilongli0101/crawler:latest
docker push shilongli0101/crawler:latest
- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Tag and Push the Docker image to GitHub Container Registry
run: |
IMAGE_NAME=ghcr.io/${{ github.repository_owner }}/crawler:latest
IMAGE_NAME=$(echo $IMAGE_NAME | tr '[A-Z]' '[a-z]')
docker tag shilongli0101/crawler:latest $IMAGE_NAME
docker push $IMAGE_NAME