feat: bump version #39
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: Push Docker Image to DockerHub | |
on: | |
push: | |
branches: [main] | |
env: | |
DOCKER_USERNAME: gengjiawen | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
IMAGE_NAME: js-engines | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ env.DOCKER_USERNAME }} | |
password: ${{ env.DOCKER_PASSWORD }} | |
- name: Generate docker date tag | |
id: evaluate-js | |
run: | | |
echo "::set-output name=result::$(node -p 'let now = new Date();let t = `${now.getFullYear()}-${now.getMonth()+1}-${now.getDate()}`;t')" | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
push: true | |
tags: ${{ env.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:latest, ${{ env.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:${{ steps.evaluate-js.outputs.result }} |