Skip to content

Commit

Permalink
chore: update workflows config.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Mar 14, 2023
1 parent a1e2c8f commit ae14d9d
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,26 @@ jobs:
steps:
- uses: actions/checkout@master

- name: Docker login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }}
- name: Generate Changelog
id: changelog
uses: jaywcjlove/changelog-generator@main
with:
filter-author: (小弟调调™)
filter: (^[\s]+?[R|r]elease)|(^[R|r]elease)

- name: Build docker-static-website image
run: docker build -t docker-static-website .
# Create Docker Image
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Tags & Push docker-static-website
run: |
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
docker tag docker-static-website ${{ secrets.DOCKER_USER }}/docker-static-website:$VERSION
docker tag docker-static-website ${{ secrets.DOCKER_USER }}/docker-static-website:latest
docker push ${{ secrets.DOCKER_USER }}/docker-static-website:$VERSION
docker push ${{ secrets.DOCKER_USER }}/docker-static-website:latest
- name: Build and push image:latest
uses: docker/build-push-action@v3
with:
push: true
context: .
platforms: linux/amd64,linux/arm64
tags: ${{ secrets.DOCKER_USER }}/linux-command:latest

0 comments on commit ae14d9d

Please sign in to comment.