Skip to content

Commit

Permalink
Update docker-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
yasyx authored May 28, 2024
1 parent d2428da commit c79c9a3
Showing 1 changed file with 41 additions and 12 deletions.
53 changes: 41 additions & 12 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,47 @@
name: Docker Image CI
# name: Docker Image CI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
# on:
# push:
# branches: [ "master" ]
# pull_request:
# branches: [ "master" ]

jobs:
# jobs:

build:
# build:

runs-on: ubuntu-latest
# runs-on: ubuntu-latest

# steps:
# - uses: actions/checkout@v4
# - name: Build the Docker image
# run: docker build . --file Dockerfile --tag yasyx/datax-job-runner:v1.0.0

name: Docker Publish
on:
push:
branches:
- master
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: docker build . --file Dockerfile --tag yasyx/datax-job-runner:v1.0.0
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to Docker
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: yasyx/datax-job-runner:v1.0.0

0 comments on commit c79c9a3

Please sign in to comment.