Skip to content

refactor: 开放0.0.0.0访问 #20

refactor: 开放0.0.0.0访问

refactor: 开放0.0.0.0访问 #20

Workflow file for this run

name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
# runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4 # pull代码
- name: Build src
run: |
cargo build --release --verbose
- name: Run tests
run: |
cargo test --verbose
- name: Docker login
uses: docker/login-action@v3
with:
registry: ${{ secrets.REGISTRY_DOMAIN }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
# - name: Build and push Docker image
# uses: docker/build-push-action@v5
# with:
# context: .
# push: true
# tags: ${{ secrets.REGISTRY_DOMAIN }}/a2cd/rs-hello-world:latest
- name: Build and push image
env:
REGISTRY: ${{ secrets.REGISTRY_DOMAIN }}
NAMESPACE: a2cd
IMAGE_NAME: rs-hello-world
IMAGE_TAG: latest
run: |
docker build -t $REGISTRY/$NAMESPACE/$IMAGE_NAME:$IMAGE_TAG .
docker push $REGISTRY/$NAMESPACE/$IMAGE_NAME:$IMAGE_TAG