Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Node.js to reduce friction deploying Node projects #8

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions up/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
FROM golang:1.15

LABEL version="1.0.0"
LABEL maintainer="Apex"
LABEL repository="http://github.com/apex/actions"
LABEL homepage="http://github.com/apex/actions/up"
LABEL "com.github.actions.name"="Up"
LABEL "com.github.actions.description"="Perform Up application operations"
LABEL "com.github.actions.icon"="chevron-up"
LABEL "com.github.actions.color"="white"

RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get install -y nodejs

ENV CI true
RUN curl -sf https://up.apex.sh/install | sh
RUN curl -sf https://raw.githubusercontent.com/apex/up/master/install.sh | sh
RUN chmod +x /usr/local/bin/up

RUN go get github.com/apex/actions/up/cmd/up-wrapper

ENTRYPOINT ["up-wrapper", "deploy", "--no-build"]
ENTRYPOINT ["up-wrapper"]
CMD ["deploy", "--no-build"]
14 changes: 0 additions & 14 deletions up/action.yml

This file was deleted.

24 changes: 6 additions & 18 deletions up/cmd/up-wrapper/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,11 @@ func main() {
// proxy to up(1)
start := time.Now()

// run `up upgrade` if UP_CONFIG is present
if os.Getenv("UP_CONFIG") != "" {
if err := up("upgrade"); err != nil {
log.Fatalf("error upgrading: %s\n", err)
}
}

// run the user-specified action command
if err := up(args...); err != nil {
cmd := exec.Command("up", args...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err = cmd.Run()
if err != nil {
log.Fatalf("error: %s", err)
}

Expand All @@ -74,12 +70,4 @@ func main() {
log.Fatalf("error writing slack message: %s", err)
}
}
}

// up executes with the given arguments.
func up(args ...string) error {
cmd := exec.Command("up", args...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
return cmd.Run()
}
}